I realize the short answer may be 'no,' but perhaps this is worth asking again.
If I am witting a Kivy app with a couple thousand of lines - then would it be possible to write some classes in another kv file?
This would make it so much easier to edit, correct errors, make changes... etc.
Just to clarify - the .KV files would be a continuation of each other - not pointing to a parallel app.
Some expert insight would be greatly appreciated - Thank you.
There are two ways to load the . kv file into code or an Application.
A KV file is a Kivy language file created by Kivy, an open-source Python library used to develop multi-touch enabled, cross-platform applications. It stores source code in the Kivy syntax, which may include rule definitions, a root widget, dynamic class definitions, and templates.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With