#1
  1. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154

    [wxPython] Remove Command Prompt?


    Is there any way that you can create a Python program through wxPython and also remove the command prompt? This way you would only have the wxPython window of your program and no command prompt in the back. Is this possible?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Location
    Bimingham,AL
    Posts
    68
    Rep Power
    11
    on windows rename the file extention to .pyw from .py. It should open with no command prompt when you double click it( if you have python associated to .pyw extension).
  4. #3
  5. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    Thanks wx uab. One more question, what happens when I compile this to an executable application for either windows or for mac (depending on the compiler I use). Will it also work like the .pyw extension?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Location
    Bimingham,AL
    Posts
    68
    Rep Power
    11
    No, just changing the extension wont work for py2exe .

    It depends on the option you specify in the py2exe setup script. You can avoid the console by using window option

    Here is an example script

    Code:
    # setup.py
    from distutils.core import setup
    import py2exe
          
    setup(windows=["hw.pyw"])
    Hope that helps.
  8. #5
  9. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    . Thanks a lot wx uab. That's exactly what I need. I just don't like using wxPython and having the console window in the back.

IMN logo majestic logo threadwatch logo seochat tools logo