If You Can Change any Other Attributes of Label You can Follow this.....

Exmaple:

from tkinter import *

window = Tk()
window.title("Dynamically Altering")
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(pady=20)


label1['bg']="green"                                                             # Change Background Color
label1['fg']="yellow"                                                            # Change Foreground Color
label1['text']="Dynamically Altered From Hello world"    # Change Text
label1['relief']="ridge"                                                        # Change Relief Attributes

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