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
-
- import tkinter as tk
- from tkinter import ttk
- app = tk.Tk()
-
- app.title("Python GUI App with icon")
-
- app.iconbitmap(r'C:\Users\prakashraj\Downloads\py1.ico')
-
- 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)