Python-Mainloop Does not work

Asked

Viewed 139 times

1

I need some help, I’m starting now and I’m getting kkk,
The situation is as follows:
I’m making a simple screen, but the mainloop function does not work.
If I use the terminal and use class creates the "..." for identation... But when I do the mainloop function to run does not perform, I believe I have to get out of this identation but I do.
If I use Tkinter, it triggers F5, it generates an invalid syntax message and
puts the focus on python version number 6. below pictures: Terminal

Tkinter

  • 1

    Missing the two dots and indentation, def __init__(...):

  • Ola Miguel, when I put the two points there where you spoke, ta invalid syntax.

  • hi Jonga - your problem is easy to solve, but you are mixing a lot of things still - without really understanding what is system message, what is language, what is inside a block, etc.... I suggest you take some more basic documentation or tutorial, and then come back. From a link in the links here: https://wiki.python.org.br/DocumentacaoPython If you only answer this specific problem better, it won’t help you much.

1 answer

0

Try to do it this way

from tkinter import *


class Janela:
    def __init__(self, master=None):
        pass


raiz = Tk()
Janela(raiz)
raiz.mainloop()

Browser other questions tagged

You are not signed in. Login or sign up in order to post.