Python Tkinter GUI 🐍 | Greet User Button & Label

Опубликовано: 08 Май 2026
на канале: Leisure Codes
159
5

A simple Python Tkinter example that creates a GUI with one button and one label. 🐍
When you click the button, it updates the label text with a greeting.

🔎 Code Logic (Quick Explanation):
tk.Tk() → creates the root GUI window.
label = tk.Label(...) → displays text on the window.
button = tk.Button(..., command=greet_user) → creates a clickable button.
greet_user() → updates the label text with a greeting when button is clicked.
root.mainloop() → runs the GUI loop so the window stays interactive.

Try this mini Tkinter project to get started with Python GUI development! 🚀

#Python #Tkinter #PythonGUI #PythonProgramming #PythonShorts #CodingForBeginners #LearnPython