Hey Guys! Today we will be learning the geometry code in tkinter (also called Python GUI)
Process of executing the python geometry code through
- Set a value for the interface
- Set a title(optional)
- Now, write the code of geometry
How to write geometry in Python GUI through Tkinter?
Here, you have imported tkinter through this code…..
Set a value for the interface
win = tkinter.Tk()
Now, you need to set the value for the interface. Here the value for interface is
Why this process? This process is done to copy the properties in
Set a title(optional)
What will this do? It will set the
title of the interface.
Write the code of geometry
Now, we are going to set geometry in python gui (tkinter)…..
win is the value for the interface.
People Also Visit: Adsense Issue Scanner
In English language, it says “Set the geometrical size of
win to the width of 300 and height of 100.
Let’s analyze the whole code….
import tkinter win = tkinter.Tk() win.title('TITLE') win.geometry('300x100') win.mainloop()
People Also Read: How to make simple browser for Android using WebView
Let’s translate the whole code in English…
import tkinter: Hey, Python! Import the inbuilt function of GUI (
win = tkinter.Tk(): Now, set the value of
win.title('TITLE'): It’s an order, set the
titleof the interface into TITLE
win.geometry('300x100'): Right now, set the size to 300 of width and 100 of height.
win.mainloop(): Okay!!! Now, That’s it.
This is the whole process of geometry in python gui tkinter
WooW!! Comment your confusion……