Monday, May 25, 2020

Tkinter pack example


from tkinter import *

root = Tk()
root.geometry("800x600")

for i in range(5):
    Label(root, text="heading1", relief=GROOVE).pack(fill=BOTH, expand=True)
for i in range(5):
    Label(root, text=str(i), relief=GROOVE).pack(side=RIGHT, fill=BOTH, expand=True)
for i in range(5):
    Label(root, text=str(i), relief=GROOVE).pack(side=BOTTOM, fill=BOTH, expand=True)
for i in range(5):
    Label(root, text=str(i), relief=GROOVE).pack(side=LEFT,fill=BOTH, expand=True)
root.mainloop()

No comments:

Post a Comment

python class topic video