import kivy kivy.require('1.9.1') # stuff i wrote import dbs import proc_hands import os_tools # this must proceed other imports from kivy.config import Config Config.set('graphics', 'position', 'custom') Config.set('graphics', 'left', 0) Config.set('graphics', 'top', 0) Config.set('graphics', 'width', os_tools.get_screen_dimensions()[0]) Config.set('graphics', 'height', os_tools.get_screen_dimensions()[1]) Config.set('graphics', 'resizable', 0) Config.set('graphics', 'borderless', 1) # kivy imports from kivy.app import App from kivy.uix.label import Label from kivy.clock import Clock from kivy.graphics import Rectangle from kivy.uix.widget import Widget from kivy.uix.layout import Layout from kivy.uix.floatlayout import FloatLayout from kivy.uix.checkbox import CheckBox from kivy.core.text.text_layout import layout_text from kivy.core.window import Window from kivy.graphics.context_instructions import Color from kivy.animation import Animation
from kivy.config import Config, ConfigParser from kivy.utils import platform import os Config.set('kivy', 'log_name', 'MO_%y-%m-%d_%_.txt') Config.set('kivy', 'log_dir', os.getcwd() + '/kivy_logs') Config.set('kivy', 'desktop', 1) Config.set('input', 'mouse', 'mouse,disable_multitouch') Config.set('kivy', 'exit_on_escape', 0) if platform == "win": Config.set('kivy', 'window_icon', 'icon.ico') else: Config.set('kivy', 'window_icon', 'icon.png') config = ConfigParser() try: config.read('mysteryonline.ini') Config.set('graphics', 'width', int(config.get('display', 'resolution').split('x', 1)[0])) Config.set('graphics', 'height', int(config.get('display', 'resolution').split('x', 1)[1])) except: Config.set('graphics', 'width', 1366) Config.set('graphics', 'height', 768) pass
def build(self): Config.set('graphics', 'width', '550') Config.set('graphics', 'height', '400') Config.write() board = BoardUI() return board
def build(self): Config.set('graphics', 'width', '1100') Config.set('graphics', 'height', '800') self.poseidonWidget = Poseidon(app=self) self.root = self.poseidonWidget self.root.jobNameLabel.text = self.config.get('job','jobName') if self.config.get('locks','lockSettings') == 'True': self.config.set('locks','lockSettings','False') self.config.write() if self.config.get('locks','lockPoint') == 'False': self.config.set('locks','lockPoint','True') self.config.write() if self.config.get('locks','measuring') == 'True': self.config.set('locks','measuring','False') self.config.write() if self.config.get('locks','lockSurvey') == 'True': self.config.set('locks','lockSurvey','False') self.config.write() if self.config.get('job','currentPointName') != '': self.config.set('job','currentPointName','') self.config.write()
def sendwifi(self): if self.check.active == True: Config.set("account", "user", self.user.text) Config.set("account", "password", self.password.text) Config.write() url1 = "http://fju1.auth.fju.edu.tw/auth/index.html/u" url2 = "http://fju2.auth.fju.edu.tw/auth/index.html/u" url3 = "http://fju3.auth.fju.edu.tw/auth/index.html/u" url4 = "http://fju4.auth.fju.edu.tw/auth/index.html/u" url5 = "http://fju5.auth.fju.edu.tw/auth/index.html/u" url6 = "http://fju6.auth.fju.edu.tw/auth/index.html/u" senddata = "?user="******"&password="******"FJU Wi-Fine :)", content=Label(text="FJU Wi-Fi Data Send Success!!"),size_hint=(None, None), size=(450,300)) for i in range(0,2): UrlRequest(url1+senddata) UrlRequest(url2+senddata) UrlRequest(url3+senddata) UrlRequest(url4+senddata) UrlRequest(url5+senddata) UrlRequest(url6+senddata) popup.open()
def build(self): root = self.root Config.set ('input','mouse','mouse,disable_multitouch') # disable multi-touch file_name = '../grasp_db/unlabeled_grasps.dat' file_object = open(file_name, 'rb') # binary encoding self.grasps = pickle.load(file_object) shuffle(self.grasps) # randomly sort images self.renderer = Renderer(self.grasps[0]) save_button = SaveButton(labeled_grasps = self.grasps) next_button = NextButton(grasps = self.grasps) help_button = HelpButton() rot_left_button = RotLeftButton(pos_hint = {'x':.58,'y':.15}, size_hint = (.1,.07), text = 'Roll left') rot_right_button = RotRightButton(pos_hint = {'x':.58,'y':.05}, size_hint = (.1,.07), text = 'Roll right') rot_up_button = RotUpButton(pos_hint = {'x':.7,'y':.15}, size_hint = (.1,.07), text = 'Roll up') rot_down_button = RotDownButton(pos_hint = {'x':.7,'y':.05}, size_hint = (.1,.07), text = 'Roll down') zoom_in_button = ZoomInButton(pos_hint = {'x':.82,'y':.15}, size_hint = (.1,.07), text = 'Larger') zoom_out_button = ZoomOutButton(pos_hint = {'x':.82,'y':.05}, size_hint = (.1,.07), text = 'Smaller') compare_image = Image(pos_hint = {'top':.84,'x':.05}, size_hint = (.4, .4), source = 'shoe_compare1.png') compare_image2 = Image(pos_hint = {'top':.44,'x':.05}, size_hint = (.4, .4), source = 'shoe_compare2.png') root.add_widget(self.renderer) root.add_widget(save_button) root.add_widget(next_button) root.add_widget(help_button) root.add_widget(zoom_in_button) root.add_widget(zoom_out_button) root.add_widget(rot_left_button) root.add_widget(rot_right_button) root.add_widget(rot_up_button) root.add_widget(rot_down_button) root.add_widget(compare_image) root.add_widget(compare_image2) return root
def build(self): Config.set('input','mouse', 'mouse,disable_multitouch') self.title = 'Snarky Screening' self.root = Builder.load_string(kv) self.root.remove_widget(self.root.ids.bottom_layout) self.root.add_widget(self.root.ids.bottom_layout) fc = FileChooserIconView() fc.on_submit = self.handle_selection self.popup = Popup(title='Open file', content=fc) self.root.ids.snarky_opendialog.on_release = self.popup.open self.root.remove_widget(self.root.ids.snarky_divider) self.root.remove_widget(self.root.ids.snarky_opendialog) self.root.ids._context_menu.add_widget(self.root.ids.snarky_divider) self.root.ids._context_menu.add_widget(self.root.ids.snarky_opendialog) if UseLucidaFax: self.root.ids.snarky_chatstream.font_name = 'LucidaFax' self.root.ids.snarky_chatstream.text += """ Welcome to a [b]Snarky Screening[/b]! [i]You[/i] need to kick off [i]auto-scroll[/i] by scrolling this text up so you can see the whole thing. You'll also need to re-do it if you [i]resize[/i] the window.""" if len(argv) > 1: self.root.ids.video.source = argv[1] reactor.listenTCP(8000, EchoFactory(self))
def build(self): Config.set('graphics', 'width', '300') Config.set('graphics', 'height', '200') self.title = "Unicode to Zawgyi Converter" self.root = Builder.load_file("gui.kv") return self.root
def _encoder_selected(self, encoder_pos): self._encoder_point = encoder_pos Logger.info('Encoder point set at: {}'.format(str(encoder_pos))) Config.set(self.section, 'encoder_point', json.dumps(self._encoder_point)) self._configure_encoder() self._selecting_encoder = False self._enable_all()
def build(self): Config.set('graphics', 'width', '200') Config.set('graphics', 'height', '200') self.clock = Clock.schedule_interval(self.update, 1) # define the ClockEvent object self.root = Builder.load_file('clock_demo.kv') return self.root
def __init__(self, api, language=None, **kwargs): resource_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'resources') resource_add_path(resource_path) resource_add_path(os.path.join(resource_path, 'objects')) resource_add_path(os.path.join(resource_path, 'shaders')) self.last_print = LastPrint() self.api = api self.setting_translation = SettingsMapper(self.api) if language: lang = language else: lang = locale.getdefaultlocale()[0] Logger.info("Specifed Language Locale: %s" % lang) if lang not in self.supported_languages: lang = 'en_GB' Window.size = (1000, 700) Window.minimum_width = 1000 Window.minimum_height = 700 super(PeachyPrinter, self).__init__(**kwargs) self.lang = lang Config.set("input", "mouse", "mouse,disable_multitouch") Config.set("kivy", "exit_on_escape", 0) Config.adddefaultsection('internal') self.switch_lang(self.lang) self.manager = None
def build(self): config = self.config # Input if config.getboolean("input", "tuio"): try: KivyConfig.get("input", "tuiotouchscreen") except (NoSectionError, NoOptionError): KivyConfig.set('input', 'tuiotouchscreen', 'tuio,0.0.0.0:3333') KivyConfig.write() if config.getboolean("input", "touch"): # Enable mouse interface kv_filename = 'gameoflife-nontuio.kv' else: kv_filename = 'gameoflife-tuio.kv' # Game self.speed = config.getint("game", "speed") self.iterations_per_turn = config.getint("game", "iterations_per_turn") self.top_score = config.getint("game", "top_score") self.minimum_pieces = config.getint("game", "minimum_pieces") # Root widget self.root = Builder.load_file(kv_filename) self.root.app = self # Grid self.root.grid.rows = config.getint("grid", "rows") self.root.grid.cols = config.getint("grid", "cols") self.root.grid.cell_size = config.getint("grid", "cell_size")
def setUp(self): '''Prepare the graphic test, with: - Window size fixed to 320x240 - Default kivy configuration - Without any kivy input ''' # use default kivy configuration (don't load user file.) from os import environ environ['KIVY_USE_DEFAULTCONFIG'] = '1' # force window size + remove all inputs from kivy.config import Config Config.set('graphics', 'width', '320') Config.set('graphics', 'height', '240') for items in Config.items('input'): Config.remove_option('input', items[0]) # bind ourself for the later screenshot from kivy.core.window import Window self.Window = Window Window.bind(on_flip=self.on_window_flip) # ensure our window is correctly created Window.create_window() Window.register() Window.initialized = True Window.canvas.clear() Window.close = lambda *s: True
def configure_kivy_app(): """ Konfiguration fuer das Kivy-Window, http://kivy.org/docs/api-kivy.player.html """ Config.set('kivy', 'exit_on_escape', 1) Config.set('graphics', 'resizable', 0) Config.write()
def build(self): self.set_sizes() self.title = "Floor is Lava" Config.set('graphics', 'resizable', 0) #Config.set('graphics', 'height', str(glo.const.HEIGHT)) #Config.set('graphics', 'width', str(glo.const.WIDTH)) return FilGame()
def build(self): Config.set('graphics', 'width', self.settings.WINDOW_WIDTH) Config.set('graphics', 'height', self.settings.WINDOW_HEIGHT) game = World(self.settings) game.draw() Clock.schedule_interval(game.update, self.settings.UPDATE_SPEED) return game
def __init__(self, **kwargs): Config.set('graphics', 'width', '300') #this has to be done before calling super() Config.set('graphics', 'height', '600') super().__init__(**kwargs) self.orientation = 'vertical' self.resetDataValues() self.startDrawing()
def build(self): # Raspberry 7" resolution test Config.set('graphics', 'width', 800) Config.set('graphics', 'height', 480) game = PongGame() game.serve_ball() Clock.schedule_interval(game.update, 1.0/60.0) return game
def build(self): # Set the window's width and height Config.set('graphics', 'width', '700') Config.set('graphics', 'height', '500') self.title = "Tic Tac Toe" self.root = Builder.load_file('gui.kv') return self.root
def build(self): Config.set('graphics', 'width', '550') Config.set('graphics', 'height', '400') Config.write() board = BoardUI() Clock.schedule_interval(board.update, .1) return board
def _roi_selected(self, point1, point2, video_size): self._selecting_roi = False try: self.scanner.set_region_of_interest_from_abs_points(point1, point2, video_size) Config.set(self.section, 'roi', json.dumps(self.scanner.roi.get_points())) except: pass self._enable_all()
def load(self, path, filename, start_height): self.last_directory = path Config.set('internal', 'last_directory', self.last_directory) Config.write() self.dismiss_popup() App.get_running_app().last_print.set("file", filename) self.parent.current = 'printingui' self.parent.printing_ui.print_file(filename, start_height)
def build(self): Window.size = (1920, 1080) # Window.borderless = True Config.set('input', 'multitaction', 'tuio,192.168.3.100:3333') # Register it with the TUIO MotionEvent provider. # You obviously need to replace the PATH placeholders appropriately. TuioMotionEventProvider.register('/tuio/_hand', TuioHandMotionEvent) return Touchtracer()
def app_loop_tick(self): """Runs once every frame before any entity code or rendering.""" # Do this once but late from kivy.config import Config Config.set('graphics', 'show_cursor', 0) if Game.first_registered_entity: from kivy import platform as kivy_platform if kivy_platform == 'android': self.hide_android_soft_keys()
def build(self): Config.set('input','mouse','mouse,disable_multitouch') box = MyBoxLayout mybox = box() mybox.setfilename() return mybox
def on_server_success(self,req,result): if result == 'test1': self.text_pane = 'text1.png' self.image_pane = 'img1.jpg' if result == 'test2': self.text_pane = 'text2.png' self.image_pane = 'img2.jpg' if result == 'go_fullscreen': Config.set('graphics', 'fullscreen', 'auto')
def build(self): self.icon = 'cropped_lumpy2.png' Config.set("input", "mouse", "mouse, disable_multitouch") root = RootHome() self.title = 'hello' self.store = JsonStore('projectlist.json') from kivy.core.window import Window # Window.borderless = True return root
def build(self): global game #FIXME: THIS IS MOST CERTAINLY NOT THE WAY TO DO IT, BUT HOW ELSE ?!?!? game = Game() self.config = MainConfig() Config.set('graphics', 'width', self.config.windowWidth) #this has to be done before calling super() Config.set('graphics', 'height', self.config.windowHeight) self.screen = Screen(game=game) game.screen = self.screen return self.screen
def on_config_change(self, config, section, key, value): if key == "log_level": Config.set('kivy', 'log_level', value) Logger.debug("%s: on_config_change key %s %s" % ( APP, key, value)) if self.service and key in ('margen_ejec', 'margen_ayud'): Logger.debug( "%s: Cambiada configuracion, recalculando alarmas" % key) self.alarmas = self.calculate_alarms() self.arrancar_servicio()
def build(self): Config.set("graphics", "fullscreen", 0) Config.set("graphics", "resizable", 0) Config.set("graphics", "height", 600) Config.set("graphics", "width", 600) Config.set("kivy", "exit_on_escape", 0) Config.write() return TicTacToeGame()
def build(self): Config.set('graphics', 'width', '550') Config.set('graphics', 'height', '400') Config.write() board = BoardUI() Clock.schedule_interval(board.update, 1.0/60.0) anim = Animation(x=550, duration=3.) anim.start(board.ball) return board
def build(self): Config.set('graphics', 'resizable', '0') #Set the title and select main build file that the GUI will run from self.title = "Foreign Exchange Calculator" self.root = Builder.load_file('GUI.kv') #Run the trip details to create the values for the spinner self.getTripDetails() #Set the desired window size Window.size = (350, 700) return self.root
import os import time import kivy from kivy.config import Config from kivy.app import App from kivy.uix import camera Config.set( 'kivy', 'default_font', ['TmonBlack', './TTF/TMONBlack.ttf', None, './TTF/TMONBlack.ttf', None]) from kivy.app import App from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout from kivy.uix.popup import Popup class Upper_bar(BoxLayout): pass class Under_bar(BoxLayout): #아이디 하나 만들기 pass class box(App): Save_path = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Desktop') def capture(self): camera = self.root.ids['camera'] timestr = time.strftime("%Y%m%d_%H%M%S") camera.export_to_png("IMG_{}.png".format(timestr))
#!/usr/bin/python3 from pysimbotlib.core import PySimbotApp from kivy.logger import Logger from kivy.config import Config # Force the program to show user's log only for "info" level or more. The info log will be disabled. Config.set('kivy', 'log_level', 'info') import random if __name__ == '__main__': # possible theme value: ["default", "light", "dark"] app = PySimbotApp(theme="light", enable_wasd_control=True) app.run()
from kivy.config import Config from kivy.core.audio import SoundLoader from kivy.core.text import LabelBase from kivy.core.window import Window, Keyboard from kivy.lang import Builder from kivy.metrics import dp from kivy.resources import resource_add_path, resource_find from src import cw_typist_version from src.tutor.ReadingTutor import ReadingTutor from src.tutor.WritingTutor import WritingTutor from src.ui import layout_pc from src.ui.layout_pc import LayoutIds from src.util import cw_meta Config.set('input', 'mouse', 'mouse,disable_multitouch') class AppWindow(App): force_debug = False _sound = None _writing_tutor = None _reading_tutor = None _key_lock = False _wpm_box = None _writing_layout = None _reading_layout = None _content_block = None def build(self): if hasattr(sys, '_MEIPASS'):
import os from kivy.app import App from kivy.config import Config Config.set('graphics', 'resizable', 0) Config.set('kivy', 'exit_on_escape', 0) from kivy.core.window import Window from kivy.clock import Clock from kivy.animation import Animation from kivy.lang.builder import Builder from kivy.uix.popup import Popup from kivy.uix.button import Button from kivy.uix.textinput import TextInput from kivy.uix.floatlayout import FloatLayout from kivy.uix.boxlayout import BoxLayout from kivy.uix.screenmanager import ScreenManager, Screen from kivy.base import runTouchApp from kivy.uix.spinner import Spinner Builder.load_string(open(os.path.join("config", "kvfile.kv"), encoding="utf-8").read(), rulesonly=True) class Manager(ScreenManager): pass class PopupWarning(Popup): # PopUp do Login pass
directory = os.path.split(os.path.abspath(sys.argv[0]))[0] # sys.dont_write_bytecode = True try: import webbrowser import six.moves.urllib import kivy kivy.require('1.9.1') from kivy.app import App from kivy.config import Config # Указываем пользоваться системным методом ввода, использующимся на # платформе, в которой запущенно приложение. Config.set('kivy', 'keyboard_mode', 'system') Config.set('graphics', 'width', '350') Config.set('graphics', 'height', '600') Config.set('graphics', 'resizable', 0) # Activity баг репорта. from Libs.uix.bugreporter import BugReporter except Exception: traceback.print_exc(file=open('{}/error.log'.format(directory), 'w')) sys.exit(1) __version__ = '0.0.1' def main(): app = None
import numpy as np from kivy import metrics from kivy.app import App from kivy.app import ObjectProperty from kivy.clock import Clock from kivy.config import Config from kivy.core.window import Window from kivy.uix.screenmanager import ScreenManager, Screen from fea.FEModel.FELinearModel import FEModel from NumericInput import NumericInput from DropDownButton import SolnProcDropDown from Blackboard import Blackboard Config.set('graphics', 'resizable', False) kivy.require('1.10.0') class OpenDialog(Screen): but = ObjectProperty(None) txt_inp = ObjectProperty(None) fc = ObjectProperty(None) def open(self): location = self.fc.selection[0] part = FEModel(location) self.parent.get_screen('model').grid.part = part self.parent.get_screen('model').grid.load() self.parent.current = 'model'
from kivy.app import App from kivy.uix.button import Button from kivy.uix.codeinput import CodeInput from kivy.config import Config Config.set('graphics', 'resizable', '0') Config.set('graphics', 'width', '1024') Config.set('graphics', 'height', '768') from kivy.uix.floatlayout import FloatLayout class MyApp(App): pass def btn_press(self, instance): instance.text = 'Returning args..' if __name__ == "__main__" : MyApp().run()
from kivy.config import Config Config.set('graphics', 'width', '1706') Config.set('graphics', 'height', '960') from kivy.app import App from kivy.clock import Clock from kivy.lang import Builder from kivy.properties import NumericProperty from kivy.uix.floatlayout import FloatLayout root = """ CustomLayout: canvas: # Color: # rgba: 1, 1, 1, 1 # Rectangle: # size: root.size # Background # Color: # rgba: 1, 1, 1, 1 # Rectangle: # size: 1706, 960 # pos: 0, 0 # source: 'C:/Users/Zoe/Documents/Megascans Library/Downloaded/surface/rock_jagged_vczkdailw/vczkdailw_8K_Albedo.jpg' # Background Left Color: rgba: 1, 1, 1, 1 * root.left * root.background Rectangle: size: 553, 525 pos: 0, 435 source: 'C:/Users/Zoe/Documents/Megascans Library/Downloaded/surface/rock_jagged_vczkdailw/vczkdailw_8K_Albedo.jpg' # Background Center
# File name: gameover.py from kivy.config import Config Config.set('graphics', 'width', '1200') Config.set('graphics', 'height', '675') Config.set('graphics', 'resizable', '0') import kivy kivy.require('1.11.1') from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.lang import Builder # We need the Screen class. from kivy.uix.screenmanager import Screen Builder.load_file('widgets.kv') # Now the root widget should inherit from # Screen instead of BoxLayout. class GameoverScreen(Screen): pass class GameoverApp(App): def build(self): return GameoverScreen()
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ from kivy.app import App from kivy.lang import Builder from kivy.uix.anchorlayout import AnchorLayout from kivy.uix.boxlayout import BoxLayout from kivy.config import Config from kivy.uix.screenmanager import ScreenManager # Set Initial Window Size Config.set('graphics', 'width', '550') Config.set('graphics', 'height', '750') # Load kivy files that describe the GUI Builder.load_file('newmeetingstatus.kv') Builder.load_file('schedulemeeting.kv') Builder.load_file('calendarwidget.kv') Builder.load_file('samsungcalendar.kv') Builder.load_file('days.kv') #Builder.load_file('months.kv') Builder.load_file('events.kv') Builder.load_file('calendarnav.kv') Builder.load_file('calendarstatus.kv') Builder.load_file('calendar.kv')
from kivy.app import App from kivy.config import Config from kivy.core.window import Window from kivy.logger import Logger from kivy.uix.settings import SettingsWithSidebar, SettingsWithTabbedPanel from kivy.utils import platform from kivy.properties import DictProperty, ConfigParserProperty from kivy.lang.builder import Builder # CURRENT_DIR = path.dirname(__file__) CURRENT_DIR = Path(__file__).parent if platform == 'win': # Disable multitouch on Windows. Config.set('input', 'mouse', 'mouse,multitouch_on_demand') # Disable app stop when ESC button pressed. Config.set('kivy', 'exit_on_escape', '0') # DEFAULTS D = { 'POMODURATION': 50, 'POMOREST': 10, 'WORKTIME': 6, 'WINDOW_WIDTH': 800, 'WINDOW_HEIGHT': 600, 'WINDOW_LEFT': 368, 'WINDOW_TOP': 132, 'SCREEN': 'taskscreen', 'COLOR_SCHEME': 'TempoBlue' }
from kivy.lang import Builder from kivy.config import Config from kivy.core.window import Window import lib.accm as a import lib.nt as nt import lib.board as b import lib.endless as eb import lib.setting as setting import lib.home as home import lib.survival as survival import lib.endlesss as endless import lib.story as story #call on_pause when the window's minimized Config.set('kivy', 'pause_on_minimize', 1) #the window is not resizable Config.set('graphics', 'resizable', 0) cwidth, cheight = Window.size presentation = Builder.load_file('main.kv') class MainApp(App): icon = 'img/icon.png' def build(self): Window.bind(on_resize=self._update_rect) return presentation
Settings = pickle.load(open(".config", "r")) # Create the screen manager sm = ScreenManager() # Global variables chosenFile = '' # Constants MAIN_SCREEN_ID = 'main_screen' FILE_CHOOSER_SCREEN_ID = 'filechooser_screen' IMAGE_SCREEN_ID = "image_screen" VIDEO_SCREEN_ID = "video_screen" # Settings Config.set('graphics', 'width', '1360') Config.set('graphics', 'height', '1024') # Float Widget class FloatWidget(FloatLayout): pass # Float Widget class BoxWidget(BoxLayout): pass # Main app class MainApp(App):
from kivy.app import App import random from kivy.uix.button import Button from kivy.uix.boxlayout import BoxLayout from kivy.uix.widget import Widget from kivy.uix.gridlayout import GridLayout from kivy.uix.label import Label from kivy.config import Config Config.set('graphics', 'resizable', '0') Config.set('graphics', 'width', '640') Config.set('graphics', 'heidht', '480') class MyApp(App): number = '' def go(self, instance): self.num = random.randint(1, 10) self.lbl.text = str("Число загадано! У вас 3 попытки)") self.heal = 3 def number(self, instance): number = int(instance.text) self.lbl.text = str(number) if self.heal > 0: if number > self.num: self.lbl.text = str("Загаданое число меньше") elif number < self.num: self.heal -= 1 self.lbl.text = str("Загаданое число Больше")
import datetime import json import subprocess import signal signal.signal(signal.SIGINT, signal.default_int_handler) # Kivy libraries from kivy.app import App from kivy.clock import Clock from kivy.factory import Factory from kivy.properties import (ListProperty, NumericProperty, ObjectProperty, OptionProperty, StringProperty) from kivy.storage.jsonstore import JsonStore from kivy.config import Config Config.set('graphics', 'width', '800') Config.set('graphics', 'height', '416') Config.set('graphics', 'multisamples', 0) Config.set('graphics', 'fullscreen', 'auto') from kivy.uix.accordion import Accordion, AccordionItem from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.uix.floatlayout import FloatLayout from kivy.uix.label import Label from kivy.uix.listview import ListItemButton from kivy.uix.modalview import ModalView from kivy.uix.popup import Popup from kivy.uix.settings import Settings, SettingsWithSidebar from kivy.uix.switch import Switch from kivy.uix.tabbedpanel import TabbedPanel
0, 0.831, 0.984, 0.474, 255, 255, 1, 0.541, 0.847, 0, 255, 1, 0.988, 0.474, ) with self.canvas: Mesh(fmt=fmt, mode='triangles', indices=indices, vertices=vertices) class GlslApp(App): def build(self): EventLoop.ensure_window() return GlslDemo() if __name__ == '__main__': Config.set('graphics', 'width', '400') Config.set('graphics', 'height', '300') GlslApp().run()
import kivy from kivy.app import App from kivy.config import Config Config.set('graphics', 'width', 800) Config.set('graphics', 'height', 600) # Config.set('graphics', 'resizable', False) # from kivy.uix.gridlayout import GridLayout from kivy.core.window import Window from kivy.uix.widget import Widget from kivy.uix.label import Label from kivy.uix.button import Button from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from functools import partial import math import Global """ """ class MainLayout(Widget): def __init__(self, **kwargs): super(MainLayout, self).__init__(**kwargs) # print ("MainLayout IDs: ", self.ids) # Set up the keyboard bindings self._keyboard = Window.request_keyboard(self._on_keyboard_closed, self, 'text') if self._keyboard.widget:
from kivy.uix.button import Button from kivy.graphics import Color, Ellipse, Line from kivy.config import Config from kivy.properties import NumericProperty, ReferenceListProperty, ObjectProperty from kivy.vector import Vector from kivy.clock import Clock from kivy.core.image import Image as CoreImage from PIL import Image as PILImage from kivy.graphics.texture import Texture from kivy.uix.image import Image # Importing the Dqn object from our AI in ai.py from ai import Dqn # Adding this line if we don't want the right click to put a red point Config.set('input', 'mouse', 'mouse,multitouch_on_demand') Config.set('graphics', 'resizable', False) Config.set('graphics', 'width', '722') Config.set('graphics', 'height', '490') # Introducing last_x and last_y, used to keep the last point in memory when we draw the sand on the map last_x = 0 last_y = 0 n_points = 0 length = 0 # Getting our AI, which we call "brain", and that contains our neural network that represents our Q-function brain = Dqn(5, 3, 0.9) action2rotation = [0, 5, -5] last_reward = 0 scores = []
from kivy.app import App from kivy.uix.boxlayout import BoxLayout def on_button_clicked(label): label.text = "Hello Pythoners!" class MainWindow(BoxLayout): pass # Create main application. class HelloApp(App): def build(self): return MainWindow() # Run the main window loop, which starts the program. if __name__ == "__main__": from kivy.config import Config # We don't want a fullscreen App here. Config.set("graphics", "fullscreen", "0") HelloApp().run()
from kivy.app import App from kivy.lang import Builder from kivy.clock import Clock from kivy.core.window import Window from kivy.config import Config from components.LayoutManager import LayoutManager Config.set('kivy', 'log_level', 'info') # Config.set('kivy', 'log_level', 'critical') Config.set('graphics', 'borderless', 0) Config.set('graphics', 'width', 1080) Config.set('graphics', 'height', 720) # Config.set('graphics', 'window_state', 'minimized') Config.set('graphics', 'window_state', "visible") Config.set('input', 'mouse', 'mouse,multitouch_on_demand') Config.write() kv_lay = Builder.load_file('../data/chill_layout.kv') Clock.max_iteration = 5000 # określa maksymalną liczbę zagniżdżonych zegarów Window.restore() layout_manager = LayoutManager() class ChillApp(App): def build(self): self.icon = '../data/graphics/CMDownloader_logo.png' self.title = 'Chill Music Downloader' return layout_manager.window_manager
# Importing the Kivy packages from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.button import Button from kivy.graphics import Color, Ellipse, Line from kivy.config import Config from kivy.properties import NumericProperty, ReferenceListProperty, ObjectProperty from kivy.vector import Vector from kivy.clock import Clock # Importing the Dqn object from our AI in ia.py from ai import Dqn # Adding this line if we don't want the right click to put a red point Config.set('input', 'mouse', 'mouse,multitouch_on_demand') # Introducing last_x and last_y, used to keep the last point in memory when we draw the sand on the map last_x = 0 last_y = 0 n_points = 0 # the total number of points in the last drawing length = 0 # the length of the last drawing # Getting our AI, which we call "brain", and that contains our neural network that represents our Q-function brain = Dqn(5, 3, 0.9) # 5 sensors, 3 actions, gama = 0.9 action2rotation = [ 0, 20, -20 ] # action = 0 => no rotation, action = 1 => rotate 20 degres, action = 2 => rotate -20 degres last_reward = 0 # initializing the last reward scores = [ ] # initializing the mean score curve (sliding window of the rewards) with respect to time
from kivymd.app import MDApp from kivy.lang.builder import Builder from kivy.uix.screenmanager import ScreenManager, Screen import speech_recognition as sr from kivymd.uix.list import OneLineAvatarIconListItem from kivymd.uix.button import MDFlatButton from kivymd.uix.dialog import MDDialog from kivymd.uix.snackbar import Snackbar from googletrans import Translator from kivy.config import Config Config.set('graphics', 'width', '330') Config.set('graphics', 'height', '560') screen_helper = """ ScreenManager: Screen01: Screen02: Screen03: <Screen01>: name: 'main' FloatLayout: orientation: 'horizontal' canvas: Rectangle: source: 'TT1.png' size: self.size pos: self.pos BoxLayout: orientation: 'vertical' MDRectangleFlatButton text:"Record" theme_text_color:"Custom"
import os # isort:skip from katrain.core.utils import find_package_resource # isort:skip os.environ["KCFG_KIVY_LOG_LEVEL"] = os.environ.get( "KCFG_KIVY_LOG_LEVEL", "warning") # isort:skip surpress info output from kivy.config import Config # isort:skip ICON = find_package_resource("katrain/img/icon.ico") # isort:skip # find icon Config.set("kivy", "window_icon", ICON) # isort:skip # set icon Config.set( "input", "mouse", "mouse,multitouch_on_demand") # isort:skip # no red dots on right click Config.set("graphics", "width", 1300) # isort:skip Config.set("graphics", "height", 1000) # isort:skip import signal import sys import threading import traceback from queue import Queue import webbrowser from kivy.app import App from kivy.core.clipboard import Clipboard from kivy.lang import Builder from kivy.resources import resource_add_path from kivy.uix.popup import Popup from kivy.uix.screenmanager import Screen from katrain.core.ai import ai_move from kivy.core.window import Window
def on_touch_move(self, touch): if 'current_line' in touch.ud: touch.ud['current_line'].points += (touch.x, touch.y) def set_color(self, new_color): self.canvas.add(Color(*new_color)) class RadioButton(ToggleButton): def _do_press(self): if self.state == 'normal': ToggleButtonBehavior._do_press(self) class PaintApp(App): def build(self): self.canvas_widget = CanvasWidget() self.canvas_widget.set_color(get_color_from_hex('#2980B9')) return self.canvas_widget if __name__ == '__main__': Config.set('graphics', 'width', '400') Config.set('graphics', 'heigt', '400') Config.set('input', 'mouse', 'mouse,disable_multitouch') from kivy.core.window import Window Window.clearcolor = get_color_from_hex('#FFFFFF') PaintApp().run()
try: global db db = MySQLdb.connect(host="nuvolino.mysql.database.azure.com", # your host, usually localhost user="******", # your username passwd="RossiniEnergy123", # your password db="sql11172989", connect_timeout = 10) except Exception: db = None print "Impossible to Connect to DB" # print "Error %d: %s" % (e.args[0],e.args[1]) Config.set('kivy', 'keyboard_mode', 'dock') # Recuperation energie precedente en utlisant pickle global table energie = 0 Pinst = 0 seconds = 0 table = ""; # File = open("/home/pi/Documents/Nuvola/table.txt","r") File = open("table.txt","r") lines = File.readlines() table = lines[0] File.close()
import Models.FuelFarm.components as components import Models.FuelFarm.functionality as functionality from kivy.app import App from kivy.uix.pagelayout import PageLayout from kivy.config import Config import kivy kivy.require("1.10.0") Config.set("graphics", "width", "1112") Config.set("graphics", "height", "849") Config.set("graphics", "resizable", False) class HMILayout(PageLayout): # Methods are associated with their class; each class would have its own .kv file @staticmethod def on_state(device): # Get the status of the device if device.state == "down": if device.group not in ["pump1", "pump2", "pump3"]: exec("functionality.{}_open()".format(device.group)) # Dynamically call valve open() else: exec("functionality.{}_on()".format(device.group)) # Dynamically call pump on() else: if device.group not in ["pump1", "pump2", "pump3"]: exec("functionality.{}_close()".format(device.group)) # Dynamically call valve close() else: exec("functionality.{}_off()".format(device.group)) # Dynamically call pump off() def populate(self):
from kivy.core.window import Window from kivy.core.audio import SoundLoader from kivy.uix.widget import Widget from kivy.properties import NumericProperty, ReferenceListProperty, ObjectProperty, ListProperty, StringProperty from kivy.uix.screenmanager import ScreenManager, Screen from kivy.vector import Vector from kivy.clock import Clock from random import randint from kivy.config import Config import serial, time, pickle, datetime, winsound, struct import time import numpy as np import tables import subprocess, signal Config.set('graphics', 'resizable', False) fixed_window_size = (1800, 1000) Config.set('graphics', 'width', str(fixed_window_size[0])) Config.set('graphics', 'height', str(fixed_window_size[1])) import threading class RewThread(threading.Thread): def __init__(self, comport, rew_time): super(RewThread, self).__init__() self.comport = comport self.rew_time = rew_time def run(self):
from kivy.config import Config Config.set('kivy', 'exit_on_escape', '0') Config.set('kivy', 'default_font', ['msgothic', 'font/DroidSansFallback.ttf']) import sys sys.setrecursionlimit(1000000) from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from kivy.uix.relativelayout import RelativeLayout from kivy.uix.stacklayout import StackLayout from kivy.uix.button import Button from kivy.uix.togglebutton import ToggleButton from kivy.uix.widget import Widget from kivy.uix.label import Label from kivy.uix.image import Image from kivy.uix.textinput import TextInput from kivy.uix.scrollview import ScrollView from kivy.uix.popup import Popup from kivy.uix.filechooser import FileChooserIconView from kivy.uix.filechooser import FileChooserListView from kivy.uix.checkbox import CheckBox import warnings import string from kivy.base import runTouchApp from kivy.lang import Builder from kivy.properties import StringProperty from kivy.properties import NumericProperty from kivy.properties import ObjectProperty