Topic: Python 3 Tkinter GUI Hello World Program
# Write a Python GUI program # using tkinter module # to diplay a window # with title "Hello World" import tkinter as tk def main(): window= tk.Tk() window.title("Hello World") window.mainloop() main()
Output:
![Python 3 Tkinter GUI Hello World Program](https://easycodebook.com/wp-content/uploads/2020/03/python-gui-tkinter-hello-world-program-example.jpg)
Python 3 Tkinter GUI Hello World Program
But we find that the title is not completely shown. Therefore we will add one more line of Python code to set (increase) size of the main window.
# Write a Python GUI program # using tkinter module # to diplay a window # with title "Hello World" import tkinter as tk def main(): window= tk.Tk() window.title("Hello World") window.geometry("400x200") window.mainloop() main()
Here we have given the size dimentions to the main window 400×200 using geometry() method.
Output:
![Python Tkinter GUI Program Hello World](https://easycodebook.com/wp-content/uploads/2020/03/python-tkinter-gui-hello-world-program-with-size-window.jpg)
Python Tkinter GUI Program Hello World
Pingback: Adding Menus to Python 3 tkinter GUI Programs | EasyCodeBook.com
Pingback: Python GUI Find Factorial by Recursive Function | EasyCodeBook.com
Pingback: Python GUI Area of Triangle | EasyCodeBook.com
I think it is a fluent sharing, I will recommend your site to my friends