There’s no such option with cxfreeze. However, I use base = "Win32GUI"
. This let remove the console window of the wx app.
To be clear, the problem is not with the console window associated to the wx app. The problem is with console windows created when external programs are run from the wx app.
Here is an example :
import wx
import threading
import os
USE_THREAD = True
class Principale(wx.Frame):
def __init__(self, titre):
wx.Frame.__init__(self, None, -1, title = titre, size = (200, 200))
self.button = wx.Button(self, wx.ID_ANY, "timeout")
self.button.Bind(wx.EVT_BUTTON, self._on_click)
def _on_click(self, event):
if USE_THREAD :
ThreadedTimeout()
else :
print("Start timeout")
os.system("timeout 5")
print("timeout done")
event.Skip(True)
class ThreadedTimeout(threading.Thread) :
def __init__(self) :
super().__init__()
self.start()
def run(self):
print("Start timeout")
os.system("timeout 5")
print("timeout done")
class MonApp(wx.App):
def OnInit(self):
fen = Principale("Test")
fen.Show(True)
self.SetTopWindow(fen)
return True
app = MonApp(0)
app.MainLoop()
When the console window associated with the wx app is not discarded, children processes send their output in this console and no other console window is created.
When the console window associated with the wx app is discarded (when freezed or run with pythonw), a new console window is created for each child process.
What I what to achieve is to discard all console windows.
wxPbConsole.py (991 Bytes)