Skip to content

Instantly share code, notes, and snippets.

@KatrinaHoffert
Created February 1, 2015 00:21
Show Gist options
  • Save KatrinaHoffert/9d109623c44a620b10b1 to your computer and use it in GitHub Desktop.
Save KatrinaHoffert/9d109623c44a620b10b1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python 1
import Tkinter as tk 2
class Application(tk.Frame): 3
def __init__(self, master=None):
tk.Frame.__init__(self, master) 4
self.grid() 5
self.createWidgets()
def createWidgets(self):
self.quitButton = tk.Button(self, text='Quit',
command=self.quit) 6
self.quitButton.grid() 7
app = Application() 8
app.master.title('Sample application') 9
app.mainloop() 10
@azze-r
Copy link

azze-r commented Feb 1, 2015

You may have to specificate your version of python, in fact, Tkinter is specifical to Python 2.6 and less.
But to pyhton3 the library's name is tkinter, (and not Tkinter).
So, it's better to use the last version of python, that is to say python3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment