Your code, cleaned up, so it actually works (find another tutorial that doesn't include the unnecessary crap, and explains things, like http://effbot.org/tkinterbook/button.htm or one of these https://wiki.python.org/moin/TkInter ). Note that the button doesn't do anything because there is no "command=" provided.
from tkinter import * class Window() : def __init__(self, master = None) : self.master = master self.init_window() def init_window(self): self.master.title("GUI") quitButton = Button(self.master, text="Quit", bg="red") quitButton.grid() root = Tk() root.geometry("400x300") app = Window(root) root.mainloop()