Create Application Title And Icon In Python GUI

Intro

In this blog, I am going to create an application title and set app icon in Python GUI application. When a user opens the application it will display  the title with icon in application screen.

Software requirement

Python 3.5 and IDLE (Python 3.5)

Programming code

  1. #Create App icon in Python GUI Application  
  2. import tkinter as tk  
  3. from tkinter import ttk  
  4. app = tk.Tk()  
  5. #Application Title  
  6. app.title("Python GUI App with icon")  
  7. #Set App icon  
  8. app.iconbitmap(r'C:\Users\prakashraj\Downloads\py1.ico')  
  9. #Calling Main()  
  10. app.mainloop()  

About the code

  • First, I am importing the tkinter modules.
  • Next, I assign a class and variables.
  • Next, I create application title and set app icon.
  • Finally, I have started the windows event loop by calling the mainloop method then execute the code.

Icon 

 
 
Output(App without title & icon)
 
 
 
Output(App with title & icon) 
 
 
Ebook Download
View all
Learn
View all