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:
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:
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