Coding Tutorials Hub

Learn coding with simple code, clear explanations, and examples

Python TKinter GUI - Label Widget

📄 Code


import tkinter as tk

# Create the main window
root = tk.Tk()
root.title("Tkinter-GUI Label Tutorial")
root.geometry("500x100")

# Create a label
label = tk.Label(root, text="This is a label", font=("Arial", 14), fg="white", bg="blue")
label.pack(pady=10)

# Run the application
root.mainloop()
        
💡 Output