wx.App console window [Windows]

siwiak at gmail.com siwiak at gmail.com
Fri Jul 13 00:55:29 CEST 2007


On 13 Lip, 00:28, kyoso... at gmail.com wrote:
> On Jul 12, 3:44 pm, siw... at gmail.com wrote:
>
>
>
> > Hi All,
>
> > I'm looking for a way to  hide console window created by wx.App class.
>
> > examplary code below:
>
> > import wx
>
> > class Gui(wx.App):
> >         def __init__(self, *pargs, **kwargs):
> >                 wx.App.__init__(self, *pargs, **kwargs)
>
> > if __name__ == "__main__":
> >     app = Gui()
> >     app.MainLoop()
>
> > produces a blank console window (than dies).
>
> > What shall I do to make wx.App run without raising console window?
>
> > thanks in advance
>
> Save the file as a *.pyw. And I would recommend adding the following 2
> lines to your __init__ :
>
> <code>
>
> frame = wx.Frame(None, wx.ID_ANY, title='My Title')
> frame.Show()
>
> </code>
>
> Maybe even stick in a panel object for that matter.
>
> Mike

Thank you Mike, *.pyw made the first part of the trick just perfectly.
Thanks to your answer I was able to ask google proper question
concerning second part. Below (for possible future readers) I attach
solution I found:

People looking for possibility of running wx.App no console version
after py2exe compilation:
in setup script change 'console = ['foo.py']' for 'windows = ['foo.py']




More information about the Python-list mailing list