Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import * #Import every function from tkinter class.
- root = Tk() #Create main window.
- text1 = Label(root, text = "Hello World!", fg = "blue") #Label() function with some arguments. :)
- button1 = Button(root, text = "Click me!", bg = "green",) #Button function with some arguments. :]
- #text1 and button1 are widgets. Widgets are objects that you put in to your window/frame. xD
- text1.pack() #Display the label.
- button1.pack()
- root.mainloop() #Keeps the program running until closed.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement