Python / Kivy App running only once

后端 未结 2 856
礼貌的吻别
礼貌的吻别 2021-01-24 00:21

I\'m running a very simple python (3.5) script using Spyder IDE from Anaconda platform.

from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.gr         


        
相关标签:
2条回答
  • 2021-01-24 00:50

    This issue is similar to the question "Python Spyder initializing Hello World Kivi app once?" on the webpage Python Spyder initializing Hello World Kivi app once?, I gave an answer there, please refer to it.

    0 讨论(0)
  • 2021-01-24 00:51

    Not that much Kivy-related problem. Spyder probably keeps old stuff in memory? Try in a simple interpreter type your code line by line. Then close the app and try again typing TestApp().run() - the same three lines.

    This way you'll see that if the old stuff (variables, classes, whatever is still accessible) is present, Kivy won't allow you to launch the app (still a mistery to me, maybe because of window-related code?)

    If there is something in Spyder to flush old stuff from memory, then set it after each Kivy exit and you should be good to go.

    0 讨论(0)
提交回复
热议问题