r/pythonhelp • • Nov 22 '21

root=Tk() not workig for tkinter.....!

please help me:

code:

from tkinter import *
root =Tk()
l=Label(root,text="hehehehe")
l.pack()
root.mainloop()

0 Upvotes

3 comments sorted by

1

u/sentles Nov 22 '21

You need to call root.mainloop(), not l.mainloop.

1

u/[deleted] Nov 22 '21

Ooh yeah thanks.. but my program doesn’t even go there it’s stuck on the 2nd line root=Tk() it says Tk is not defined

0

u/[deleted] Nov 22 '21

[deleted]

1

u/[deleted] Nov 22 '21

But i used the from tkinter import*