Hide DOS console for .pyc file

Discussion in 'Python' started by Muddy Coder, Sep 11, 2010.

  1. Muddy Coder

    Muddy Coder Guest

    Hi Folks,

    For a quick testing purpose, I deliver .pyc files to my customer. I
    don't want the black DOS console appearing behind my GUI, but I have
    no idea how to do it. Somebody can help? Thanks!


    Cosmo
     
    Muddy Coder, Sep 11, 2010
    #1
    1. Advertising

  2. In message
    <>, Muddy
    Coder wrote:

    > For a quick testing purpose, I deliver .pyc files to my customer. I
    > don't want the black DOS console appearing behind my GUI, but I have
    > no idea how to do it. Somebody can help? Thanks!


    Don’t run it on Windows.
     
    Lawrence D'Oliveiro, Sep 11, 2010
    #2
    1. Advertising

  3. On Fri, 10 Sep 2010 20:28:52 -0700, Muddy Coder wrote:

    > Hi Folks,
    >
    > For a quick testing purpose, I deliver .pyc files to my customer. I
    > don't want the black DOS console appearing behind my GUI, but I have no
    > idea how to do it. Somebody can help? Thanks!


    Google is your friend.

    Googling for "Python dos window" brings up this as the third hit:

    http://www.velocityreviews.com/forums/t344026-how-to-run-python-in-
    windows-w-o-popping-a-dos-box.html



    --
    Steven
     
    Steven D'Aprano, Sep 11, 2010
    #3
  4. Muddy Coder

    Dave Angel Guest

    On 2:59 PM, Muddy Coder wrote:
    > Hi Folks,
    >
    > For a quick testing purpose, I deliver .pyc files to my customer. I
    > don't want the black DOS console appearing behind my GUI, but I have
    > no idea how to do it. Somebody can help? Thanks!
    >
    >
    > Cosmo
    >

    In Windows, the executable file statically determines whether a console
    is created. There are two executables shipped with Python, python.exe
    and pythonw.exe. You want to use the latter.

    The real question is how to cause Windows to run that rather than
    python.exe. Answer depends on how your use is launching his program.

    If he's starting from a shortcut, change the name of the executable on
    the shortcut. If he's starting by double-clicking on the script name,
    change the extension of the script from .py to .pyw

    You mention that you're shipping only .pyc files. If that's the case,
    add one more, a .pyw that imports your main script. Of course, that may
    mean changing that script a little so it works as a module.

    DaveA
     
    Dave Angel, Sep 11, 2010
    #4
  5. Muddy Coder

    Peter Otten Guest

    Lawrence D'Oliveiro wrote:

    > In message
    > <>, Muddy
    > Coder wrote:
    >
    >> For a quick testing purpose, I deliver .pyc files to my customer. I
    >> don't want the black DOS console appearing behind my GUI, but I have
    >> no idea how to do it. Somebody can help? Thanks!

    >
    > Don’t run it on Windows.


    If you switch the OS for every minor problem you'll run out of operating
    systems pretty soon...
     
    Peter Otten, Sep 11, 2010
    #5
  6. Muddy Coder

    Terry Reedy Guest

    On 9/11/2010 6:32 AM, Lawrence D'Oliveiro wrote:
    > In message<i6fivp$76v$00$-online.com>, Peter Otten wrote:
    >
    >> Lawrence D'Oliveiro wrote:
    >>
    >>> In message
    >>> <>, Muddy
    >>> Coder wrote:
    >>>
    >>>> For a quick testing purpose, I deliver .pyc files to my customer. I
    >>>> don't want the black DOS console appearing behind my GUI, but I have
    >>>> no idea how to do it. Somebody can help? Thanks!


    Have them run with pythonw.exe instead of python.exe. That is how IDLE
    does it.

    --
    Terry Jan Reedy
     
    Terry Reedy, Sep 11, 2010
    #6
  7. On Sep 11, 11:32 am, Lawrence D'Oliveiro <l...@geek-
    central.gen.new_zealand> wrote:
    > In message <i6fivp$76v$-online.com>, Peter Otten wrote:
    >
    > > Lawrence D'Oliveiro wrote:

    >
    > >> In message
    > >> <>, Muddy
    > >> Coder wrote:

    >
    > >>> For a quick testing purpose, I deliver .pyc files to my customer. I
    > >>> don't want the black DOS console appearing behind my GUI, but I have
    > >>> no idea how to do it. Somebody can help? Thanks!

    >
    > >> Don’t run it on Windows.

    >
    > > If you switch the OS for every minor problem you'll run out of operating
    > > systems pretty soon...

    >
    > Not if you choose a suitably flexible and portable one to begin with.




    It isn't the OP choosing, it's his client. Now, I dislike aspects of
    Windows as much as anybody, but even I can see that dictating which OS
    your client is allowed to use if they want to run your program is
    sometimes not a viable option.
     
    Jonathan Hartley, Sep 13, 2010
    #7
    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. Ben Fairbank
    Replies:
    2
    Views:
    5,495
  2. Philippe C. Martin

    dos box appears when clicking .pyc

    Philippe C. Martin, Feb 11, 2005, in forum: Python
    Replies:
    3
    Views:
    337
    Tim Roberts
    Feb 13, 2005
  3. john san
    Replies:
    19
    Views:
    773
    Diez B. Roggisch
    Feb 18, 2005
  4. tomhr
    Replies:
    27
    Views:
    1,457
    Mike Wahler
    Jan 12, 2006
  5. Robert Wallace

    my own perl "dos->unix"/"unix->dos"

    Robert Wallace, Jan 21, 2004, in forum: Perl Misc
    Replies:
    7
    Views:
    312
    Michele Dondi
    Jan 22, 2004
Loading...

Share This Page