HelloWorld GUI Application In Python

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

  1. import tkinter as tk    
  2. from tkinter import ttk    
  3. win = tk.Tk()    
  4. win.title("Python GUI App")    
  5. ttk.Label(win, text="Hello World").pack()    
  6. 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

Ebook Download
View all
Learn
View all