Search code examples
pythonkivy

I have an issue in Kivy each time I try to run my code


error when trying to run my program

does anyone know what's wrong here? Just installed kivy and was following a guide, when I entered this code it was supposed to be bring up like a text box but it just keeps bringing up this.


Solution

  • You just have a typo:

    if __name__ == "__main__":
    

    You forgot to put the underscores around the main.

    BTW, what this line does is, it just tells the program whether to run or not.

    __name__ == "__main__" means if you are running the same file where the code is written, then run it, but if you are importing this file from some other file, then don't run the code which is in this if block.