Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide Windows console with python Tkinter?

I tried renaming my .py file to .pyw. But compiling with py2exe does not make a difference.

I tried using root.withdraw() but all it does is freeze the application, prevent the initial canvas from popping up, and fail to remove the command prompt window anyways.

Does anyone have a solution?

My root is: root = Tk()

like image 745
Max Avatar asked Jun 09 '10 18:06

Max


1 Answers

I ended up finding the solution on http://ubuntuforums.org/showthread.php?t=728170

In short, the solution is to change the line setup(console=["yourapp.py"]) to setup(windows=["yourapp.py"]), otherwise, it is the same code as the rest of the py2exe tutorial.

like image 87
2 revs, 2 users 60% Avatar answered Sep 21 '22 02:09

2 revs, 2 users 60%