Skip to main content

Basic Attribute of Tkinter

 





from tkinter import *
root = Tk()
root.geometry("722x233")
root.title("Aakash")


# Label
# text = add text
# bg = background color
# fg  text color
# font = font style  font=("Segoe Script",30,"bold") ||  font="Georgia 30 bold"
# padx = padding x
# pady padding y

# pack
# side = TOP ,BOTTOM,LEFT,RIGHT
# anchor = on which side north east(ne),north west(nw),south west(sw),
                                                        south east(se)
# fill  file=X, fill=Y
# padx
#pady

troot = Label(text="AK",bg="gray",fg="yellow",padx=23,pady=23,
        font="Georgia 30 bold",borderwidth=5,relief=SUNKEN).pack(side=LEFT,
        anchor="se",fill=X,padx=20,pady=20)


root.mainloop()




Comments