Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Tkinter Tutorial
- from tkinter import * #Import tkinter module
- tk = Tk() #Create a tk window
- tk.title("Tkinter Hello World Program") #Set title of the widow
- def output(): #Button function
- print("You clicked me")
- #Create a button widget, with text "click me" and command output function
- b = Button(tk, text="click me", command=output)
- #Create button, show button on window
- b.pack()
- tk.mainloop() #Tkinter mainloop, the windows remains open
Add Comment
Please, Sign In to add comment