wx.App console window [Windows]

Discussion in 'Python' started by siwiak@gmail.com, Jul 12, 2007.

  1. Guest

    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
    , Jul 12, 2007
    #1
    1. Advertising

  2. Guest

    On Jul 12, 3:44 pm, 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
    , Jul 12, 2007
    #2
    1. Advertising

  3. Guest

    On 13 Lip, 00:28, wrote:
    > On Jul 12, 3:44 pm, 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']
    , Jul 12, 2007
    #3
  4. Guest

    On Jul 12, 5:55 pm, wrote:
    > On 13 Lip, 00:28, wrote:
    >
    >
    >
    > > On Jul 12, 3:44 pm, 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']


    I like the GUI interface to py2exe that I found here:
    http://xoomer.alice.it/infinity77/eng/GUI2Exe.html

    Quite handy.

    Mike
    , Jul 13, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MuZZy
    Replies:
    7
    Views:
    1,747
    Mike Hewson
    Jan 7, 2005
  2. Miktor
    Replies:
    7
    Views:
    12,038
    Joe Bacigalupa
    Aug 9, 2005
  3. pkellner
    Replies:
    0
    Views:
    501
    pkellner
    Apr 27, 2007
  4. Kevin Walzer
    Replies:
    2
    Views:
    556
    Kevin Walzer
    Aug 14, 2011
  5. Kris Rudin

    console app w/o seeing console?

    Kris Rudin, Nov 11, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    126
    Randy Charles Morin
    Nov 11, 2003
Loading...

Share This Page