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

前端 未结 3 763
情话喂你
情话喂你 2021-02-12 15:33

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

3条回答
  •  鱼传尺愫
    2021-02-12 16:22

    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.

提交回复
热议问题