टिंकर एक पायथन लाइब्रेरी है जिसका उपयोग कार्यात्मक जीयूआई-आधारित एप्लिकेशन बनाने और विकसित करने के लिए किया जाता है। टिंकर विजेट प्रदान करता है जिसका उपयोग एप्लिकेशन के दृश्य और कार्यात्मक प्रतिनिधित्व के निर्माण के लिए किया जा सकता है।
मान लीजिए कि हमने अपने एप्लिकेशन में कुछ विजेट्स को परिभाषित किया है। यदि हम किसी ईवेंट में विजेट का नाम प्राप्त करना चाहते हैं, तो इसे event.widget["text"] का उपयोग करके प्राप्त किया जा सकता है किसी फ़ंक्शन के अंदर कीवर्ड। हम नाम को प्रिंट () . के अंदर उपयोग करके प्रिंट कर सकते हैं समारोह।
उदाहरण
# 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("700x300")
# Define a function to delete the shape
def on_click():
print (win.winfo_children())
# Create a canvas widget
canvas=Canvas(win, width=500, height=300)
canvas.pack()
# Create a button to delete the button
Button(win, text="Click", command=on_click).pack()
win.mainloop() आउटपुट
यदि हम उपरोक्त कोड चलाते हैं, तो यह एक बटन के साथ एक विंडो प्रदर्शित करेगा।

यदि हम बटन पर क्लिक करते हैं, तो आउटपुट स्क्रीन पर विजेट का नाम दिखाएगा।
[<tkinter.Canvas object .!canvas>, <tkinter.Button object .!button>]