In this blog, I am going to create a Hello world GUI application in Python.
Software requirement
Python 3.5 and IDLE (Python 3.5)WProgramming code
- import tkinter as tk
- from tkinter import ttk
- win = tk.Tk()
- win.title("Python GUI App")
- ttk.Label(win, text="Hello World").pack()
- win.mainloop()
About the code
First, I am Importing tkinter module, the tkinter is the GUI library for Python. Then I assign class and variable and set a title and add the Hello World label in that code. Then I start the windows event loop by calling the mainloop method then execute the code.
Output