wx.App console window [Windows]

kyosohma at gmail.com kyosohma at gmail.com
Fri Jul 13 00:28:52 CEST 2007


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




More information about the Python-list mailing list