r/programminghelp • u/[deleted] • Nov 23 '21
Python Please i dont know whats wrong
code:
from tkinter import *
tk=Tk()
l=Label(tk,text="hehehehe")
l.pack()
tk.mainloop()
error:
Exception has occurred: NameError
name 'Tk' is not defined
Please tell me whats wrong... Im using python 3.10.0 and have installed Tkinter... but i cant move beyond the tk=Tk() error.
4
Upvotes
1
u/[deleted] Nov 23 '21
What tutorial are you following?
Instead of:
from tkinter import *you should have used
import tkinter as tk