TKinter hello world



    The following code imports the tkinter module, creates a root widget, and uses the Label() function to create a text-label widget. The widget is given a 30-pixel wide and 10-pixel high border, and is then packed into a tk.Tk object. This object is then used as the mainloop() object in a Python program.

    import tkinter as tk
    from tkinter import ttk
    root = tk.Tk()
    ttk.Label(root, text="Hello, World!", padding=(30, 10)).pack()
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.