Hello world program in tkinter. This program will print the hello world in the new window as an output for new beginners in graphical user interface program in python. By using this program we can print the text “hello world” in the output using GUI tkinter python program.
Tkinter in Python
Tkinter is a Python binding for the Tk graphical user interface toolkit. It is Python’s de facto standard GUI and the standard Python interface to the Tk GUI toolkit. Tkinter comes standard with Python installations on Linux, Microsoft Windows, and Mac OS X. Tkinter is derived from the Tk gui.
Definition of GUI
Instead of text-based user interfaces, typed command labels, or text navigation, the graphical user interface helps users to communicate with electronic devices through graphical icons and audio indicators such as primary notation. This is the sample method to execute program hello world program in tkinter.
Execute Tkinter Python Program
Create a python file with .py extension
Copy nd paste the above program in your text pad
Save your program and open terminal
Type cd Documents and typeyourfilename
Select the file using this command python3 filename.py
import tkinter as tk win = tk.Tk() win.title("Hello World") mylabel=tk.Label(win,text="Hello World", font=("Roboto",60,"bold"), fg = "red" ) mylabel.pack() win.mainloop()