[Python] Cannot start Tkinter window in Visual Studio with Python Tools

Discussão em 'Python' iniciado por Stack, Agosto 3, 2025.

  1. Stack

    Stack Membro Participativo

    I am developing using Python Tools for Visual Studio in Visual Studio 2013 community edition on Windows 8.1. My problem is that I am unable to get a Tkinter window to start. I have tried using this code:

    from tkinter import *
    Tk()


    When I launch this code from IDLE and such, I am able to get a tkinter window, as shown:

    [​IMG]

    However, when I start this in Visual Studio, no Tkinter window appears, only the console window. No error is thrown. Example:

    [​IMG]

    How do I get the Tkinter window to appear when I launch the program in Visual Studio with Python tools?

    Edit: Also, when I try to do this from the Python interactive window in VS, this is what I get, with no window appearing:

    >>> from tkinter import *
    >>> Tk()
    <tkinter.Tk object at 0x02D81FD0>

    Continue reading...

Compartilhe esta Página