Objectmix
Tags Register Mark Forums Read

wx.App console window [Windows] : Python

This is a discussion on wx.App console window [Windows] within the Python forums in Programming Languages category; 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...


Object Mix > Programming Languages > Python > wx.App console window [Windows]

Reply

 

LinkBack Thread Tools
  #1  
Old 07-12-2007, 03:44 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default wx.App console window [Windows]

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

  #2  
Old 07-12-2007, 05:29 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: wx.App console window [Windows]

On Jul 12, 3:44 pm, siw... 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

  #3  
Old 07-12-2007, 05:55 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: wx.App console window [Windows]

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

  #4  
Old 07-12-2007, 08:05 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: wx.App console window [Windows]

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

Reply

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
KBS: why is there a console window on startup? usenet TCL 3 11-08-2007 04:24 AM
Is it possible to embed a console window c#? usenet CSharp 7 10-18-2007 10:33 AM
Windows GUI app with Console Window? usenet xharbour 1 09-08-2007 02:22 AM
Console window in MDI Application. usenet CSharp 1 08-23-2007 03:52 AM
Kate - how do you switch between text window and console? usenet Editors 0 03-09-2007 05:52 AM


All times are GMT -5. The time now is 08:36 AM.

Managed by Infnx Pvt Ltd.