from tkinter import *
#Create the window
root = Tk()
#Modify root window
root.title("Simple GUI")
root.geometry("200x50")
app = frame(root)
label = Label(app, text = "This is a label")
label.grid()
#kick of the event loop
root.mainloop()
I am following a tutorial of YouTube to learn about Python tkinter GUI. But when I run the above code it comes with an error.
Traceback (most recent call last):
File "C:/Users/Nathan/Desktop/Python/Python GUI/Simple GUI.py", line 14, in <module>
app = frame(root)
NameError: name 'frame' is not defined
I know it is something to do with frame
, I tried Frame
and it doesn't work.
Can you please help me make it work, Thanks!
I am currently using Python 3.5 and the tutorial is in 2.7