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:

tkinter with grid