Tkinter python 3 GUI hello world example program. This program will print the hello world in the new window as an output for new beginners in grapical user interface program in python. By using this program we can print the text “hello world” in the output using GUI tkinter python program.
import tkinter as tk
win = tk.Tk()
mylabel=tk.Label(win,text=”Hello World”,font=(“Roboto”,60,”bold”), fg = “red” )
What is 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.
What is 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
How to execute the GUI Tkinter program in linux?
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