If you want to know what attributes you have given in your label then you can do it. From here you can find all the attributes in your label. 

Using for loop.

Example:

from tkinter import *

window = Tk()
window.title("About To Know Attributes Using for loop")
window.geometry("800x450+500+86")
window.config(bg="#FF6103")

label1 = Label(window, text="Hello World", bg="white",borderwidth=10, fg="red",
font=("helvetica", 20,"bold"), width=30, height=6, relief="solid")

label1.pack()

for item in label1.keys():
print(item, ":", label1[item])

window.mainloop()

Write Down Code Your Code Editor. To show Your Output. If Use Pycharm Press Shift+F10 and Show Your Output.


Enjoy............



Post a Comment

Previous Post Next Post