Packing Button in Tkinter | python Tkinter GUI

 

Packing Button in Tkinter | python Tkinter GUI

from tkinter import *
root = Tk()
root.geometry("655x333")

def hello():
print("hello tkinter button")

def name():
print("My name is shreyash")

frame = Frame(root, borderwidth=6, bg="purple")
frame.pack(side=LEFT, anchor="nw")

b1 = Button(frame, fg="red", text="Print now", command=hello)
b1.pack(pady=25)

b2 = Button(frame, fg="red", text="Print now", command=name)
b2.pack()

root.mainloop()