Kivy language in VS Code

140 views
Skip to first unread message

Lis

unread,
Jun 19, 2023, 5:39:04 AM6/19/23
to Kivy users support
Hi, everyone! I've just started learning Kivy and have some troubles with running program (I use VS Code)

So, I have two files:
1) main.py
Screenshot 2023-06-19 at 12.32.46.png

2) first.kv
Screenshot 2023-06-19 at 12.30.11.png

And I've tried linking two files via path link, also tried like I show in photos example, but code doesn't work. At the moment error is "Invalid instance in App.root"

I guess that it does happen, because pluggins that I've installed don't work, but then how can I compile the code and make it work, using two different languages (it was the most valuable part of exercise)? Is there any pluggins or extensions for VS Code that compile .kv language?

Appreciate your help!

Elliot Garbus

unread,
Jun 19, 2023, 7:37:34 AM6/19/23
to kivy-...@googlegroups.com
You are not instancing your root widget. 

Change:
return ScatterTextWidget
To:
return ScatterTextWidget() # the () creates the object 

Sent from my iPhone

On Jun 19, 2023, at 11:39 AM, Lis <love.sa...@gmail.com> wrote:


Hi, everyone! I've just started learning Kivy and have some troubles with running program (I use VS Code)

So, I have two files:
1) main.py
<Screenshot 2023-06-19 at 12.32.46.png>

2) first.kv
<Screenshot 2023-06-19 at 12.30.11.png>


And I've tried linking two files via path link, also tried like I show in photos example, but code doesn't work. At the moment error is "Invalid instance in App.root"

I guess that it does happen, because pluggins that I've installed don't work, but then how can I compile the code and make it work, using two different languages (it was the most valuable part of exercise)? Is there any pluggins or extensions for VS Code that compile .kv language?

Appreciate your help!

--
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/12ed3c9c-35e7-4791-afbd-f8dec7209798n%40googlegroups.com.
<Screenshot 2023-06-19 at 12.32.46.png>
<Screenshot 2023-06-19 at 12.30.11.png>

Lis

unread,
Jun 19, 2023, 9:47:32 AM6/19/23
to Kivy users support
Thank you!

понедельник, 19 июня 2023 г. в 14:37:34 UTC+3, ElliotG:
Reply all
Reply to author
Forward
0 new messages