[Python] When i work with tkinter no window pops up and my command line terminal acts as if a...

Discussão em 'Python' iniciado por Stack, Julho 31, 2025.

  1. Stack

    Stack Membro Participativo

    I have been trying out the tkinter library for python and have been noticing a strange pattern of behavior that I encounter but the behavior doesnt occur with the tutorial videos. I have tried:

    1. '

    from tkinter import *

    root = Tk()

    lableee = Label(root, text = "hi")

    lableee.pack()

    root.mainloop()


    '

    2. `

    import tkinter as tk

    tk._test()`


    (within the command line terminal)

    python -m tkinter

    For the first two items above a window that pops up should appear but it doesn't. For all three of the items above my command line beggins to not take any new commands unless i click the trashcan icon to kill the terminal and then press CTRL + j to pull it back up (VS code).

    The code isnt meant to do anything significant yet. Please help me get the window to pop up when the program runs. Thanks

    Continue reading...

Compartilhe esta Página