how to do modules with kivy language...

8 views
Skip to first unread message

Degenerate Tech

unread,
Aug 28, 2020, 10:15:40 AM8/28/20
to Kivy users support
i want to use mymodule.py file in another kivy app.. In pure python i did..but python and kivy language how to do that?

######mymodule.py###########
 from kivy.app import App
from kivy.uix.boxlayout import*

class MyWidget(BoxLayout):pass 



######but what will be kv file name  ? how to define ?


mymodule.py

Degenerate Tech

unread,
Aug 28, 2020, 10:18:04 AM8/28/20
to Kivy users support
i have uploded mymodule.py in pure python which i know ...but i wnt to know with kivy file

Elliot Garbus

unread,
Aug 28, 2020, 10:26:32 AM8/28/20
to kivy-...@googlegroups.com

Assume the following files:

CustomWidget.py

CustomWidget.kv

main.py – main app file that uses the CustomWidget

 

Inside CustomWidget.py

Builder.load_file(‘CustomWidget.kv’)  # you can name the file whatever you want

 

Inside main.py

import CustomWidget

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/62173388-bcc9-49c5-84ff-bd13a3ca2049o%40googlegroups.com.

 

Degenerate Tech

unread,
Aug 28, 2020, 10:28:44 AM8/28/20
to Kivy users support
where should i call the method ? within the class?


On Friday, August 28, 2020 at 7:56:32 PM UTC+5:30, Elliot Garbus wrote:

Assume the following files:

CustomWidget.py

CustomWidget.kv

main.py – main app file that uses the CustomWidget

 

Inside CustomWidget.py

Builder.load_file(‘CustomWidget.kv’)  # you can name the file whatever you want

 

Inside main.py

import CustomWidget

 

 

 

From: Degenerate Tech
Sent: Friday, August 28, 2020 7:18 AM
To: Kivy users support
Subject: [kivy-users] Re: how to do modules with kivy language...

 

i have uploded mymodule.py in pure python which i know ...but i wnt to know with kivy file

On Friday, August 28, 2020 at 7:45:40 PM UTC+5:30, Degenerate Tech wrote:

i want to use mymodule.py file in another kivy app.. In pure python i did..but python and kivy language how to do that?

 

######mymodule.py###########

 from kivy.app import App

from kivy.uix.boxlayout import*

 

class MyWidget(BoxLayout):pass 

 

 

 

######but what will be kv file name  ? how to define ?

 

 

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.

Degenerate Tech

unread,
Aug 28, 2020, 10:42:26 AM8/28/20
to Kivy users support
done ...thank you 
Reply all
Reply to author
Forward
0 new messages