Python Program using Tkinter with the grid method


In this program, You will learn how to implement Tkinter with the grid method in Python.


from tkinter import *

tk = Tk()

Example: How to implement Tkinter with the grid method in Python

from tkinter import *

tk = Tk()
tk.title("Xiith.com")
tk.geometry("600x500")

name = Label(tk, text="Enter your name").grid(row=0, column=0)
t1 = Entry(tk).grid(row=0, column=1)
email = Label(tk, text="Enter your email").grid(row=1, column=0)
t2 = Entry(tk).grid(row=1, column=1)
b1 = Button(tk, text="Submit").grid(row=2, column=1)

tk.mainloop()

Output:

Xiith is created for educational, experimental, and schooling purpose. Examples on Xiith are made easier to make a better or basic understanding. Tutorials, testimonials, and examples are continuously checked to avoid delusion, but we cannot take complete responsibility of all programs on Xiith. When you are operating this site, you have to agree to read and accept our terms of use, cookie and privacy policy.Copyright © 2020 by Xiith. All Rights Reserved. About us.