Skip R.
Skip R.

Reputation: 459

Tkinter opens console window with window

I am a complete newbie at Python. Meanwhile, I'm working with Tkinter to integrate a GUI into my application using Python 2.7. This is the code so far:

import Tkinter

top = Tkinter.Tk()
top.mainloop()

However, when I execute the file, a console window and the GUI pops up. How do I get rid of the console window during startup?

Upvotes: 1

Views: 1685

Answers (1)

user764357
user764357

Reputation:

Rename your Python script as .pyw (not .pyc). This will tell the invoker to to instantiate a console window. Source

Note however, this will work for non-GUI based scripts too which can cause undesireqable behaviour - such as not being able to see your script.

Upvotes: 2

Related Questions