def main(): import sys, os if len(sys.argv) == 2: filepath = os.path.join(os.getcwd(), sys.argv[1]) app = Pie(filepath=filepath) else: app = Pie() app.run()
def demo(path, rootQueue): '''Event loop for demo application path: the .kv file to load rootQueue: a Queue that the root widget should be pushed onto (or None if creation fails) ''' def _build(): try: root = kivy.lang.Builder.load_file(path) rootQueue.put(root) return root except: rootQueue.put(None) raise app = kivy.app.App() app.build = _build app.run()
class Level23(kivy.uix.screenmanager.Screen): character_killed = False num_coins = 25 num_coins_collected = 0 coins_ids = {} char_anim_duration = 0.25 num_monsters = 2 num_fires = 2 num_collisions_hit = 0 num_collisions_level = 30 class Level24(kivy.uix.screenmanager.Screen): character_killed = False num_coins = 20 num_coins_collected = 0 coins_ids = {} char_anim_duration = 0.25 num_monsters = 3 num_fires = 2 num_collisions_hit = 0 num_collisions_level = 30 app = CointexApp() app.title = "CoinTex" app.icon = 'cointex_logo.png' app.run()
def custome_callback(self, btn): src = app.run(self.textInput.text) self.image.source = "custom.jpg"