我刚刚学习,我试图运行这个简单的代码
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
class Header(Widget):
pass
class PingStat(Widget):
pass
class MyPingApp(App):
def build(self):
c = BoxLayout()
a = PingStat()
b = Header()
c.add_widget(a)
c.add_widget(b)
return a
if __name__ == "__main__":
MyPingApp().run()
MyPing.kv:
#:kivy 1.0.9
<Header>
canvas:
Color:
rgb: 1, 1, 1
Label:
font_size: 30
text: "Pinger"
center: 100, 100
<PingStat>
Label:
text: "This"
center: 100, 500
Label:
text: "wat"
center: 300, 500
控制台反复出现此错误,但窗口弹出正常:
[关键] [时钟]警告,迭代完成太多 在下一帧之前。检查您的代码,或增加 Clock.max_iteration属性