python kivy问题无法load_file
hello.pyfrom kivy.app import App
from kivy.lang import Builder
presentation = Builder.load_file("SimpleKivy.kv")
class MainApp(App):
def build(self):
return presentation()
MainApp().run()
SimpleKivy.kv
<Button>:
font_size:40
color:0,1,0,1
size_hint:0.3,0.2
<FloatLayout>:
Button:
text:"Kivy"
pos_hint:{"x":0,'y': 0}
Button:
text:"tutor"
pos_hint:{"right":0.5,'top':1}
报错
File "C:/Users/yuncong/PycharmProjects/test/hello.py", line 8, in <module>
MainApp().run()
File "C:\Users\yuncong\Anaconda3\lib\site-packages\kivy\app.py", line 800, in run
root = self.build()
File "C:/Users/yuncong/PycharmProjects/test/hello.py", line 6, in build
return presentation()
TypeError: 'NoneType' object is not callable