Python runs program once but won't run again -
so i'm new here i've been searching around internet few days , can't find figure out. have basic program (code @ bottom) , if it's first time in 10+ hrs, it'll run fine , it's supposed (basically nothing @ point). if exit window , try run again, it'll give "python has stopped working" error message.
python 3.6.1 , kivy 1.10.0 (but program doesn
from kivy.app import app kivy.uix.button import button class testapp(app): def build(self): return button(text='hello world') testapp().run()
any advice or appreciated.
what output of code?
from kivy.app import app kivy.uix.button import button def exit(self): app.get_running_app().stop() btn1 = button(text='hello world 1') btn1.bind(on_press= exit) class testapp(app): def build(self): return btn1 if __name__ == '__main__': testapp().run()
this how can exit app button.
you should find programm in taskmanager called "python" , has same icon displayed in taskbar.
how run code ? (in pycharm or in terminal?)
i hope help.
Comments
Post a Comment