Skip to content

Instantly share code, notes, and snippets.

@fnielsen
Created October 1, 2012 10:37
Show Gist options
  • Save fnielsen/3810836 to your computer and use it in GitHub Desktop.
Save fnielsen/3810836 to your computer and use it in GitHub Desktop.
Tkinter simple example
from Tkinter import *
def hello():
"""Callback function for button press."""
print "Hello World"
# Main root window
root = Tk()
# A button with a callback function
Button(root, text="Press here", command=hello).pack()
# .pack() method is necessary to make the button appear
# Event loop
root.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment