Getting rid of Python console in wxPython under Windows

console, python, windows, windows-console, wxpython

Solution

Others have already suggested of renaming from py to pyw. If you instead refer to Output redirection pass redirect=True when creating the wx.App class.

See for instance http://www.wxpython.org/docs/api/wx.App-class.html

The signature of `__init__` is

`__init__(self, redirect=False, filename=None, useBestVisual=False, clearSigInt=True)`

If you set `redirect=True` and filename different from None, `sys.stdout` and `sys.stderr` will be redirect to filename. Note that on Windows and Mac redirect default value is True. If `redirect==True and filename is None`, the output will be printed in a popup window different from your other frames. This can be very useful so that while debugging you can follow what is happening, while not cluttering the user interface with the internals of your app in release mode.

Problem

Possible Duplicate: How can I hide the console window in a PyQt app running on Windows? How to get rid of the console that shows up as standard output when running wxPython programs in Windows?

Original source

Related problems