अधिकतर, टेक्स्ट या छवियों को प्रदर्शित करने के लिए एप्लिकेशन में टिंकर लेबल विजेट का उपयोग किया जाता है। हम कॉन्फ़िगरेशन(**विकल्प) का उपयोग करके लेबल विजेट जैसे इसकी टेक्स्ट प्रॉपर्टी, रंग, पृष्ठभूमि या अग्रभूमि रंग को कॉन्फ़िगर कर सकते हैं विधि।
यदि आपको लेबल विजेट को गतिशील रूप से संशोधित करने या बदलने की आवश्यकता है, तो आप लेबल विजेट के टेक्स्ट को बदलने के लिए एक बटन और एक फ़ंक्शन का उपयोग कर सकते हैं।
उदाहरण
# Import the required libraries
from tkinter import *
# Create an instance of tkinter frame or window
win = Tk()
# Set the size of the tkinter window
win.geometry("700x350")
# Define a function update the label text
def on_click():
label["text"] = "Python"
b["state"] = "disabled"
# Create a label widget
label = Label(win, text="Click the Button to update this Text",
font=('Calibri 15 bold'))
label.pack(pady=20)
# Create a button to update the label widget
b = Button(win, text="Update Label", command=on_click)
b.pack(pady=20)
win.mainloop() आउटपुट
जब आप उपरोक्त कोड चलाते हैं, तो यह विंडो में एक लेबल टेक्स्ट और एक बटन दिखाएगा।

जब आप बटन पर क्लिक करते हैं, तो यह केवल लेबल टेक्स्ट को अपडेट करेगा।
