Hello.
I'm using Linux OS, Python 2 and the last version of Kivy framework.
Here i have 2 files that i have typed them exactly as what i watched on a kivy tutorial video.
Fist file is "main.py":

from kivy.app import App

from kivy.uix.scatter import Scatter
from kivy.uix.label import Label
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.textinput import TextInput
from kivy.uix.boxlayout import BoxLayout

class ScatterTextWidget(BoxLayout):
    pass

class TutorialApp(App):
    def build(self):
        return ScatterTextWidget()


if __name__ == "__main__":
    TutorialApp().run()

And the second one is "Tutorial.kv":

<ScatterTextWidget>:
    orientation: "vertical"
    TextInput:
        id: my_textinput
        font_size: 120
        size_hint_y: None;
        height: 200
        text: "Hello World!"
    FloatLayout:
        Scatter:
            Label:
                text: my_textinput.text
                font_size: 120

Both files are on my desktop. When i run "python main.py" a black empty window appears only. Why the kivy file can't be read?! Where is the problem?

Well, i find the problem myself.
The name of the file "Tutorial.kv" should be in lowercase, so i changed it to "tutorial.kv".

And also there was a little problem in "tutorial.kv" line 6. The ; after None was extra that i deleted.

One of the zillion rules of Kivy:
Kivy looks for a .kv file with the same name as your App class in lowercase
(minus “App” if it ends with ‘App’. eg. TutorialApp -> tutorial.kv)

Compared to Python syntax, Kivy syntax really sucks.

I would only use it if you have a touch sensitive screen.

Edited 1 Year Ago by vegaseat

This question has already been answered. Start a new discussion instead.