Skip to content

Instantly share code, notes, and snippets.

@jarobins
Created July 19, 2013 14:44
Show Gist options
  • Save jarobins/6039617 to your computer and use it in GitHub Desktop.
Save jarobins/6039617 to your computer and use it in GitHub Desktop.
My base starting script for tk applications in python
# File: simpletk_base.py
# Programmer: Jake Robinson
# Date: 03MAR2013
from Tkinter import *
from ttk import *
class App:
def __init__(self, master):
frame = Frame(master)
frame.pack()
self.button = Button(frame, text="QUIT", command=root.destroy)
self.button.pack(side=LEFT)
self.hi_there = Button(frame, text="Hello", command=self.say_hi)
self.hi_there.pack(side=LEFT)
def say_hi(self):
print "hi there, everyone!"
root = Tk()
app = App(root)
root.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment