how to create a window in tkinter code example
Example 1: make a window tkinter
import Tkinter
top = Tkinter.Tk()
top.mainloop()
Example 2: self.app = Tk()
import tkinter as tk
class MainApplication(tk.Frame):
def __init__(self, parent, *args, **kwargs):
tk.Frame.__init__(self, parent, *args, **kwargs)
self.parent = parent
<create the rest of your GUI here>
if __name__ == "__main__":
root = tk.Tk()
MainApplication(root).pack(side="top", fill="both", expand=True)
root.mainloop()
Example 3: how to create tkinter window
import tkinter
master = tkinter.Tk()
master.mainloop()