from Tkinter import * class App: def __init__(self, master): self.frame = Frame(master,width=1015,height=550) self.frame.pack() self.b_red = Button(self.frame, text="Back", fg="red", command=self.frame.quit, height = 30, width = 148) self.b_red.place(x=110,y=500) self.b_green = Button(self.frame, text="Select", fg="green",command=self.say_hi,height = 30, width = 148) self.b_green.place(x=370,y=500) def say_hi(self): print "hi there, everyone!" root = Tk() root.geometry("1015x550") app = App(root) root.mainloop()