user3475931
user3475931

Reputation: 1

Integration of console window with GUI using TkInter

I have a python script that runs the GUI which is coded using Tkinter. Problem is when i run the script, there are 2 windows opened. One is the GUI and other is the black console window. I need to integrate both the windows so that when I start the script only one window appears. Any ideas are much appreciated.

Thanks in advance.

Upvotes: 0

Views: 911

Answers (2)

Sheesh Mohsin
Sheesh Mohsin

Reputation: 1453

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: 3

drez90
drez90

Reputation: 814

(I am pretty sure there is a better way, but) one way is to change the .pyc object file extension to .pyw and the console will not appear when you launch your GUI using the .pyw file.

Upvotes: 0

Related Questions