python3 kivy builder: - > [CRITICAL] [Application]没有创建窗口。终止应用程序运行

问题描述 投票:0回答:1

尝试使用Python3.6构建一个kivy应用程序但是错误收到“window not building”

气馁的文件The kivy file

目录保存Directory saved

显示错误Displayed error

书面代码Wwritten code

python-3.x kivy kivy-language
1个回答
3
投票

与注释中提到的@ el3ien一样,在.kv文件中,“Widgets”元素不应该包含括号。没有角度括号的元素是根元素,构造函数返回根元素。没有创建窗口,因为构建/构建器函数没有返回根

可以只有一个根元素。除非你表示根元素

return RootClassName()
in build function from the python file, Python won't know which is root from the .kv file if all elements have angled brackets around it.
© www.soinside.com 2019 - 2024. All rights reserved.