如何制作kivy文件的独立模块并与python-fi集成

2024-04-20 04:05:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我是kivy的初学者,想为我的项目做一个简单的GUI。在

当我从一个python文件和一个kivy文件开始时,它工作得很好。但现在我的计划是制作一个复杂的GUI,它包含许多行代码,kivy文件正在变得越来越大。所以我想制作kivy的单独模块(这里分别生成kivy文件并导入一个或多个文件),并考虑与python文件集成。我没有找到任何相关的示例/甚至没有找到GitHub存储库。在

请帮我解决上述问题。在

提前谢谢。在


Tags: 模块文件项目代码github示例gui计划
1条回答
网友
1楼 · 发布于 2024-04-20 04:05:53

是的,有可能。在

Is it possible to read from more than one .kv file in Kivy app?

Yes it is! You can import .kv files inside files just like normal python files by starting with:

#:include otherfile.kv
If you want the file to unload and reload first you can force the import typing

#:include force otherfile.kv
instead.

All this as written in the Kivy Language Documentation which is full of useful clarifications.

相关问题 更多 >