wxpython ms-dos black window popping up in background

Discussion in 'Python' started by icarus, Sep 9, 2008.

  1. icarus

    icarus Guest

    platform: windows xp professional, python 2.5, wxpython

    When I double-check on my program file test.py (for simplicity I'll be
    using this code below), I see the window just fine. But the ms-dos
    black window pops up in the background. On Linux, no issues at all.

    How can I get rid of that ms-dos black window in the background?
    something I need to add to my code? a setting to adjust in windows?
    thanks in advance.


    #!/usr/bin/python
    import wx

    appwx = wx.App()

    frame = wx.Frame(None, -1, 'test.py')
    frame.Show()

    appwx.MainLoop()
    icarus, Sep 9, 2008
    #1
    1. Advertising

  2. icarus

    Chris Rebert Guest

    You need to have the script be run by pythonw.exe as opposed to python.exe
    pythonw.exe suppresses the DOS box from coming up and should be used
    for running GUI applications such as yours.

    Regards,
    Chris

    On Tue, Sep 9, 2008 at 1:33 PM, icarus <> wrote:
    > platform: windows xp professional, python 2.5, wxpython
    >
    > When I double-check on my program file test.py (for simplicity I'll be
    > using this code below), I see the window just fine. But the ms-dos
    > black window pops up in the background. On Linux, no issues at all.
    >
    > How can I get rid of that ms-dos black window in the background?
    > something I need to add to my code? a setting to adjust in windows?
    > thanks in advance.
    >
    >
    > #!/usr/bin/python
    > import wx
    >
    > appwx = wx.App()
    >
    > frame = wx.Frame(None, -1, 'test.py')
    > frame.Show()
    >
    > appwx.MainLoop()
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >




    --
    Follow the path of the Iguana...
    http://rebertia.com
    Chris Rebert, Sep 9, 2008
    #2
    1. Advertising

  3. icarus

    icarus Guest

    Oh ok. Thanks. In windows xp I just renamed the file extension to .pyw
    That did it.

    one more question...

    how do I create a pythonw standalone executable that works on w32,
    linux, mac, etc..?

    My intent is to have the process transparent to the user. He wouldn't
    even know the app was written in python. All he knows that when he
    double-clicks on it, the application pops up without the DOS black
    screen in the background (for w32 users.)






    On Sep 9, 10:49 am, "Chris Rebert" <> wrote:
    > You need to have the script be run by pythonw.exe as opposed to python.exe
    > pythonw.exe suppresses the DOS box from coming up and should be used
    > for running GUI applications such as yours.
    >
    > Regards,
    > Chris
    >
    >
    >
    > On Tue, Sep 9, 2008 at 1:33 PM, icarus <> wrote:
    > > platform: windows xp professional, python 2.5, wxpython

    >
    > > When I double-check on my program file test.py (for simplicity I'll be
    > > using this code below), I see the window just fine. But the ms-dos
    > > black window pops up in the background. On Linux, no issues at all.

    >
    > > How can I get rid of that ms-dos black window in the background?
    > > something I need to add to my code? a setting to adjust in windows?
    > > thanks in advance.

    >
    > > #!/usr/bin/python
    > > import wx

    >
    > > appwx = wx.App()

    >
    > > frame = wx.Frame(None, -1, 'test.py')
    > > frame.Show()

    >
    > > appwx.MainLoop()
    > > --
    > >http://mail.python.org/mailman/listinfo/python-list

    >
    > --
    > Follow the path of the Iguana...http://rebertia.com
    icarus, Sep 9, 2008
    #3
  4. icarus

    kaer Guest

    On 9 sep, 23:35, icarus <> wrote:
    > Oh ok. Thanks. In windows xp I just renamed the file extension to .pyw
    > That did it.
    >
    > one more question...
    >
    > how do I create a pythonw standalone executable that works on w32,
    > linux, mac, etc..?
    >
    > My intent is to have the process transparent to the user. He wouldn't
    > even know the app was written in python. All he knows that when he
    > double-clicks on it, the application pops up without the DOS black
    > screen in the background (for w32 users.)
    >
    > On Sep 9, 10:49 am, "Chris Rebert" <> wrote:
    >
    > > You need to have the script be run by pythonw.exe as opposed to python.exe
    > > pythonw.exe suppresses the DOS box from coming up and should be used
    > > for running GUI applications such as yours.

    >
    > > Regards,
    > > Chris

    >
    > > On Tue, Sep 9, 2008 at 1:33 PM, icarus <> wrote:
    > > > platform: windows xp professional, python 2.5, wxpython

    >
    > > > When I double-check on my program file test.py (for simplicity I'll be
    > > > using this code below), I see the window just fine. But the ms-dos
    > > > black window pops up in the background. On Linux, no issues at all.

    >
    > > > How can I get rid of that ms-dos black window in the background?
    > > > something I need to add to my code? a setting to adjust in windows?
    > > > thanks in advance.

    >
    > > > #!/usr/bin/python
    > > > import wx

    >
    > > > appwx = wx.App()

    >
    > > > frame = wx.Frame(None, -1, 'test.py')
    > > > frame.Show()

    >
    > > > appwx.MainLoop()
    > > > --
    > > >http://mail.python.org/mailman/listinfo/python-list

    >
    > > --
    > > Follow the path of the Iguana...http://rebertia.com


    py2exe could be what you are looking for.
    kaer, Sep 9, 2008
    #4
  5. icarus

    Larry Bates Guest

    icarus wrote:
    > Oh ok. Thanks. In windows xp I just renamed the file extension to .pyw
    > That did it.
    >
    > one more question...
    >
    > how do I create a pythonw standalone executable that works on w32,
    > linux, mac, etc..?
    >
    > My intent is to have the process transparent to the user. He wouldn't
    > even know the app was written in python. All he knows that when he
    > double-clicks on it, the application pops up without the DOS black
    > screen in the background (for w32 users.)
    >
    >
    >
    >
    >
    >
    > On Sep 9, 10:49 am, "Chris Rebert" <> wrote:
    >> You need to have the script be run by pythonw.exe as opposed to python.exe
    >> pythonw.exe suppresses the DOS box from coming up and should be used
    >> for running GUI applications such as yours.
    >>
    >> Regards,
    >> Chris
    >>
    >>
    >>
    >> On Tue, Sep 9, 2008 at 1:33 PM, icarus <> wrote:
    >>> platform: windows xp professional, python 2.5, wxpython
    >>> When I double-check on my program file test.py (for simplicity I'll be
    >>> using this code below), I see the window just fine. But the ms-dos
    >>> black window pops up in the background. On Linux, no issues at all.
    >>> How can I get rid of that ms-dos black window in the background?
    >>> something I need to add to my code? a setting to adjust in windows?
    >>> thanks in advance.
    >>> #!/usr/bin/python
    >>> import wx
    >>> appwx = wx.App()
    >>> frame = wx.Frame(None, -1, 'test.py')
    >>> frame.Show()
    >>> appwx.MainLoop()
    >>> --
    >>> http://mail.python.org/mailman/listinfo/python-list

    >> --
    >> Follow the path of the Iguana...http://rebertia.com

    >

    On Windows use py2exe and Inno Setup to create "frozen" application that is easy
    to distribute. On Mac/Linux there are other solutions.

    -Larry
    Larry Bates, Sep 9, 2008
    #5
  6. icarus top-posted:
    > one more question...


    ....deserves a separate thread.

    > how do I create a pythonw standalone executable that works on w32,
    > linux, mac, etc..?


    Either it is Python, then it is portable but no executable, or it is an
    executable, then it is standalone but not portable. I'm afraid what you are
    asking for is not possible. Other than that, others told you how to easily
    get a standalone executable.

    Uli

    [ 35 lines of uselessly quoted content removed ]

    --
    Sator Laser GmbH
    Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
    Ulrich Eckhardt, Sep 10, 2008
    #6
  7. On Sep 10, 6:48 am, James A. Donald <> wrote:
    > On Tue, 9 Sep 2008 14:35:13 -0700 (PDT), icarus <>
    > wrote:
    >
    > > Oh ok. Thanks. In windows xp I just renamed the file extension to .pyw
    > > That did it.

    >
    > > one more question...

    >
    > > how do I create a pythonw standalone executable that works on w32,
    > > linux, mac, etc..?

    >
    > I have noticed that when applications are written in Python with the
    > GUI created by PyGTK, it seems that to install the application on each
    > slightly different version of unix is a fairly major task - although
    > the creators of PyGTK proudly say that the code will run anywhere, it
    > definitely will not install anywhere - the code will only run on a
    > slightly different system after a massive and major rewrite of the
    > install for that target system.
    >
    > Horrible installs are a chronic problem GUI programs driven by
    > interpreted languages  Installing visual basic programs that worked on
    > one Windows machine to work on a very slightly different windows
    > machine was also a nightmare.
    >
    > I have not attempted to create installable wxPython windows, but
    > generally, "run anywhere" will bite you.  Still looking for a good
    > solution to "run anywhere".
    >
    > --
    >   ----------------------
    > We have the right to defend ourselves and our property, because
    > of the kind of animals that we are. True law derives from this
    > right, not from the arbitrary power of the omnipotent state.
    >
    > http://www.jim.com/     James A. Donald


    I haven't had much trouble getting wxPython applications to run in
    Windows XP and Ubuntu Hardy Heron. Of course, my GUIs aren't extremely
    complex, but I did make use of Hammond's PyWin32 package and had to
    wrap those in Platform aware conditional statements. Plus wx was
    pretty easy to install in Ubuntu, so that was cool.

    I can't really comment on other toolkits though.

    Mike
    Mike Driscoll, Sep 10, 2008
    #7
  8. icarus

    Stef Mientki Guest

    Mike Driscoll wrote:
    > On Sep 10, 6:48 am, James A. Donald <> wrote:
    >
    >> On Tue, 9 Sep 2008 14:35:13 -0700 (PDT), icarus <>
    >> wrote:
    >>
    >>
    >>> Oh ok. Thanks. In windows xp I just renamed the file extension to .pyw
    >>> That did it.
    >>>
    >>> one more question...
    >>>
    >>> how do I create a pythonw standalone executable that works on w32,
    >>> linux, mac, etc..?
    >>>

    >> I have noticed that when applications are written in Python with the
    >> GUI created by PyGTK, it seems that to install the application on each
    >> slightly different version of unix is a fairly major task - although
    >> the creators of PyGTK proudly say that the code will run anywhere, it
    >> definitely will not install anywhere - the code will only run on a
    >> slightly different system after a massive and major rewrite of the
    >> install for that target system.
    >>
    >> Horrible installs are a chronic problem GUI programs driven by
    >> interpreted languages Installing visual basic programs that worked on
    >> one Windows machine to work on a very slightly different windows
    >> machine was also a nightmare.
    >>
    >> I have not attempted to create installable wxPython windows, but
    >> generally, "run anywhere" will bite you. Still looking for a good
    >> solution to "run anywhere".
    >>
    >> --
    >> ----------------------
    >> We have the right to defend ourselves and our property, because
    >> of the kind of animals that we are. True law derives from this
    >> right, not from the arbitrary power of the omnipotent state.
    >>
    >> http://www.jim.com/ James A. Donald
    >>

    >
    > I haven't had much trouble getting wxPython applications to run in
    > Windows XP and Ubuntu Hardy Heron. Of course, my GUIs aren't extremely
    > complex, but I did make use of Hammond's PyWin32 package and had to
    > wrap those in Platform aware conditional statements. Plus wx was
    > pretty easy to install in Ubuntu, so that was cool.
    >
    >

    same with me,
    wxPython, packed with py2exe + ino setup,
    runs out of the box on XP, Vista, Ubuntu without any problem.

    cheers,
    Stef
    > I can't really comment on other toolkits though.
    >
    > Mike
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >
    Stef Mientki, Sep 10, 2008
    #8
  9. On Sep 10, 3:53 pm, James A. Donald <> wrote:
    > James A. Donald
    >
    > > > Horrible installs are a chronic problem of GUI programs driven by
    > > > interpreted languages  Installing visual basic programs that worked on
    > > > one Windows machine to work on a very slightly different windows
    > > > machine was also a nightmare.

    >
    > > > I have not attempted to create installable wxPython windows, but
    > > > generally, "run anywhere" will bite you.  Still looking for a good
    > > > solution to "run anywhere".

    >
    > Mike Driscoll
    >
    > > I haven't had much trouble getting wxPython applications to run in
    > > Windows XP and Ubuntu Hardy Heron.

    >
    > Did you attempt to create proper install packages that show up in the
    > Linux package managers, and the windows add/remove programs tool?
    >



    I used Inno Setup which creates an uninstaller, however I am not
    seeing it in my Windows Add/Remove. Odd. However, you can uninstall it
    from the Start menu entry and it works.

    Currently, I am running the application from source in Linux. But I
    plan to try cx_freeze or similar sooner or later. I haven't had need
    to distribute it since my apps are for internal use so far.

    Mike
    Mike Driscoll, Sep 10, 2008
    #9
  10. On Sep 10, 4:34 pm, Mike Driscoll <> wrote:
    > On Sep 10, 3:53 pm, James A. Donald <> wrote:
    >
    >
    >
    > > James A. Donald

    >
    > > > > Horrible installs are a chronic problem of GUI programs driven by
    > > > > interpreted languages  Installing visual basic programs that worked on
    > > > > one Windows machine to work on a very slightly different windows
    > > > > machine was also a nightmare.

    >
    > > > > I have not attempted to create installable wxPython windows, but
    > > > > generally, "run anywhere" will bite you.  Still looking for a good
    > > > > solution to "run anywhere".

    >
    > > Mike Driscoll

    >
    > > > I haven't had much trouble getting wxPython applications to run in
    > > > Windows XP and Ubuntu Hardy Heron.

    >
    > > Did you attempt to create proper install packages that show up in the
    > > Linux package managers, and the windows add/remove programs tool?

    >
    > I used Inno Setup which creates an uninstaller, however I am not
    > seeing it in my Windows Add/Remove. Odd. However, you can uninstall it
    > from the Start menu entry and it works.
    >
    > Currently, I am running the application from source in Linux. But I
    > plan to try cx_freeze or similar sooner or later. I haven't had need
    > to distribute it since my apps are for internal use so far.
    >
    > Mike


    I just tested my Inno installer again and it did put an entry in the
    Add/Remove program under Windows Vista. The machine I was looking at
    was my main development machine and probably wasn't a good example.

    Sorry about that.

    Mike
    Mike Driscoll, Sep 11, 2008
    #10
    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. Steve - DND
    Replies:
    0
    Views:
    428
    Steve - DND
    Jan 7, 2004
  2. Replies:
    1
    Views:
    575
  3. john san
    Replies:
    19
    Views:
    738
    Diez B. Roggisch
    Feb 18, 2005
  4. Paul Rubin
    Replies:
    18
    Views:
    11,052
    bodoora
    Sep 9, 2006
  5. Geert Vancompernolle

    How to run Python in Windows w/o popping a DOS box?

    Geert Vancompernolle, Jan 1, 2009, in forum: Python
    Replies:
    1
    Views:
    243
    GeertVc
    Jan 1, 2009
Loading...

Share This Page