from Tkinter import * def greet(): print "hello world" win = Frame() win.pack() Button(win, text = 'hello', command=greet).pack(side=LEFT,fill=Y) Label(win, text="Hello world").pack(side=TOP) Button(win,text='quit',command=win.quit).pack(side=RIGHT,expand=YES,fill=X) win.mainloop()