How to create windows graphic user interface with tkinter

This article will show you how to create windows GUI with python’s tkinter module. It is very easy to create a pop up window with tk module. First start up your NetBeans IDE, then create a new project as I have shown you before in my previous article. Next enter below script into the NetBeans code editor and run it!

import tkinter as tk 

win = tk.Tk() # create tk instance
win.title("tkinter GUI") # add a title

win.mainloop() # start the GUI

Basically the above python script will create an empty window with the tkinter module then start the window’s event loop by calling the mainloop method from the tk’s class instance as shown in the following graphic.

tk GUI
tk GUI