0
from kivy.app import App
from kivy.uix.label import Label

class simple(App):
    def build(self):
        return Label(text = "Hello World")

if __name__ == "main__":
    simple().run()

The above code works fine when written in the python CMD shell, but this code does not works when saved in a file.

On CMD python shell:

enter image description here

From IDLE, Sublime Text and different text editors (The file is saved on Desktop):

enter image description here

1 Answers1

0

Here's an answer to my own question. The issue was with the python path. Since I was creating the file on Desktop. It was not reading the python or specifically kivy's path correctly. Solution for this is to create or save the project in a directory inside the python's directory. It worked for me.