0

I'm new to programming and trying to use Kivy to create a simple game. I am following a tutorial, and I'm using VSCode, but I can't understand why the code I write in the .kvfile doesn't is used by the main.pyfile.

I have two files in the directory.

  1. main.py
from kivy.app import App
from kivy.uix.widget import Widget



class MainWidget(Widget):
    pass

class TheLabApp(App):
    pass

TheLabApp().run()
  1. thelab.kv
MainWidget:


<MainWidget>:
    Button:
        text: 'Hello'
        size: 400, 200

I have installed a Kivy extension, and of course the Kivy module. But when I run the code the only thing that appears is a black screen, without the button. What is happening?

rioV8
  • 24,506
  • 3
  • 32
  • 49
  • Does this answer your question? [Why don't other programs see the changes I made to a file in VS Code until I save those changes?](https://stackoverflow.com/questions/76984829/why-dont-other-programs-see-the-changes-i-made-to-a-file-in-vs-code-until-i-sav) – starball Aug 27 '23 at 06:11

1 Answers1

0

I found the solution. It is required to save the .kv file before running the code, it is just such a sily thing, but if it isn't saved it is read like if it was empty, or never changed.