E
E
Edward2282021-06-14 12:46:20
Python
Edward228, 2021-06-14 12:46:20

Why doesn't Python see the .kv file?

I wanted to make a small application, but when I started setting up kivy, I needed to use the kivy design language.
I wrote the code but for some reason it doesn't work.
Here is main.py code

from kivy.uix.button import Button
from kivymd.app import MDApp
from kivy.uix.image import Image
from kivy.core.window import Window
from kivy.uix.gridlayout import GridLayout

Window.size = (700, 300)

def launchClicker(instance):
    print('The button <%s> is being pressed' % instance.text)


class MainApp(MDApp):
    def build(self):
        pass

MainApp().run()

And more code from the main.kv file
<MainApp>
    GridLayout:
        cols:2

        GridLayout:
            cols:1
            rows:3

            Label:
                text: "Your Mom"
            Label:
                text: "Your Mom"
            Label:
                text: "Your Mom"
        Button:
            text: "Submit"

When I run there are no errors, and there are no labels that I registered either, here:
60c7256363160443400350.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question