How to hide the prompt windows when running a simple tkinter gui program?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sorno
    New Member
    • Mar 2008
    • 2

    How to hide the prompt windows when running a simple tkinter gui program?

    In windows, if I make a very simple tkinter program like:

    from Tkinter import *
    root = Tk()
    label = Label(root,text ="hello")
    label.pack()
    root.mainloop()


    There will be a window showing the "hello" label, and another windows that looks like a dos prompt behind it. Is it possible to get rid of this prompt like window?
  • elcron
    New Member
    • Sep 2007
    • 43

    #2
    Originally posted by sorno
    In windows, if I make a very simple tkinter program like:

    from Tkinter import *
    root = Tk()
    label = Label(root,text ="hello")
    label.pack()
    root.mainloop()


    There will be a window showing the "hello" label, and another windows that looks like a dos prompt behind it. Is it possible to get rid of this prompt like window?
    I believe saving it with the .pyw extension should fix that.

    Comment

    • sorno
      New Member
      • Mar 2008
      • 2

      #3
      Originally posted by elcron
      I believe saving it with the .pyw extension should fix that.
      Thanks very much, it works. I search further with this pyw and found that it works because it will use pythonw to run the program instead of python.

      Comment

      Working...