Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #72103

Re: Command prompt not shown when running Python script with subprocess on Windows

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed0.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ixokai@ixokai.io>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:Windows': 0.02; 'subject:not': 0.03; 'win32': 0.03; 'subject:Python': 0.06; 'think,': 0.07; 'input,': 0.09; 'subject:script': 0.09; 'runs': 0.10; 'cc:addr:python-list': 0.11; 'python': 0.11; 'gui': 0.12; 'windows': 0.15; 'default),': 0.16; 'file).': 0.16; 'given,': 0.16; 'subject: \n ': 0.16; 'subject:when': 0.16; 'wxpython': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'discussion': 0.18; 'app': 0.19; 'trying': 0.19; 'pfxlen:0': 0.19; 'written': 0.21; '(the': 0.22; 'command': 0.22; 'input': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'keyboard': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'script': 0.25; 'shown': 0.26; 'asking': 0.27; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'related': 0.29; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'code': 0.31; '(my': 0.31; "user's": 0.31; 'file': 0.32; 'run': 0.32; 'open': 0.33; 'url:python': 0.33; 'problem': 0.35; 'subject:with': 0.35; "can't": 0.35; 'received:209.85': 0.35; 'problem.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'url:listinfo': 0.36; 'url:org': 0.36; 'application': 0.37; 'list': 0.37; 'received:209': 0.37; 'depends': 0.38; 'files': 0.38; 'fact': 0.38; 'pm,': 0.38; 'does': 0.39; 'sure': 0.39; 'users': 0.40; 'url:mail': 0.40; 'helps': 0.61; "you're": 0.61; 'show': 0.63; 'to:addr:gmail.com': 0.65; '26,': 0.68; 'prompt': 0.68; 'silently': 0.84; 'timothy': 0.84
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=92F4yl1kWnFGeRO5/UkFTYcEaaG//UQqZyJwJcJODR8=; b=YAYudcV6eWPzFOTjFVScXGLaSSQEsdgZ2hEUGJ9OtC6BWOl/vKP0Z5+k0BI+1n9Mw+ eIyNWlYrp2CPL8Ohn3Mz5E1nDeOiLD2f5vyhyVaCM6kZeMDbF5lllxAOijstwFKwR4cm mVDrCh0z9Yk6oZqu8voJNQ3pguY+gQHbt8bNwnG21WLdRU9a21uKZInp1b+kcZhr7taj 131/L8ps2CHNjmh8NG0L1VRPmsLCRH8xfVxC64YGZNh28tN/rgzoMLtHXIYBm0qOH26P I2WyXOqMFzEpxqTmARwnkeSE6iyX7UQrwJEHwnZfAZTVH28Sc3xqCdB8d5jXz+wJQyES wevQ==
X-Gm-Message-State ALoCoQnqqmHnNBSP4VIIaf8W2eRW9oXLw5MAGvBjQeLUNHY0XSsTb6trcNCOhJSdpmdPg2s1rWZ+
X-Received by 10.58.84.65 with SMTP id w1mr25180276vey.8.1401172728899; Mon, 26 May 2014 23:38:48 -0700 (PDT)
MIME-Version 1.0
Sender ixokai@ixokai.io
X-Originating-IP [24.199.8.246]
In-Reply-To <29c26176-b573-4ac9-bf41-a18a53d7dfb9@googlegroups.com>
References <29c26176-b573-4ac9-bf41-a18a53d7dfb9@googlegroups.com>
From Stephen Hansen <me+python@ixokai.io>
Date Mon, 26 May 2014 23:38:28 -0700
X-Google-Sender-Auth Q0zh6T8TrLrcXsUW1qxj04lLkX8
Subject Re: Command prompt not shown when running Python script with subprocess on Windows
To ps16thypresenceisfullnessofjoy@gmail.com
Content-Type multipart/alternative; boundary=047d7b44fc78c67fa704fa5bf227
X-Mailman-Approved-At Tue, 27 May 2014 09:24:34 +0200
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.10362.1401175475.18130.python-list@python.org> (permalink)
Lines 82
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1401175475 news.xs4all.nl 2961 [2001:888:2000:d::a6]:33084
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:72103

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

You need to call python.exe path-to-script.py, I think, not just
path-to-script.py. See sys.executable (though that depends on if you're a
frozen app or not).

I can't be sure though because there's no code. Show code when asking
questions, it helps frame the discussion and get a better answer ;)


On Mon, May 26, 2014 at 5:03 PM,
<ps16thypresenceisfullnessofjoy@gmail.com>wrote:

> I have written a Python script with a wxPython GUI that uses
> subprocess.Popen to open a list of files that the user provides. One of my
> users would like to be able to run a Python script with my application. The
> Python script he is trying to run uses the command line and gets keyboard
> input from the user several times.
>
> The problem is that if the Python script is run on Windows with
> subprocess.Popen, no command prompt is shown (my GUI application is a .pyw
> file). The user's script runs silently but then does not quit because it is
> waiting for input, but there is no way for the input to be given, since
> there is no command prompt visible.
>
> I think this may be related to the fact that I am calling subprocess.Popen
> with shell=True. I tried calling it with shell=False (the default), but
> then I got an error that the file is not a valid Win32 application.
>
> I would appreciate any help with this problem.
>
> -- Timothy
> --
> https://mail.python.org/mailman/listinfo/python-list
>

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Command prompt not shown when running Python script with subprocess on Windows ps16thypresenceisfullnessofjoy@gmail.com - 2014-05-26 17:03 -0700
  Re:Command prompt not shown when running Python script with subprocess on Windows Dave Angel <davea@davea.name> - 2014-05-27 03:20 -0400
  Re: Command prompt not shown when running Python script with subprocess on Windows Stephen Hansen <me+python@ixokai.io> - 2014-05-26 23:38 -0700
    Re: Command prompt not shown when running Python script with subprocess on Windows ps16thypresenceisfullnessofjoy@gmail.com - 2014-05-27 16:01 -0700
      Re: Command prompt not shown when running Python script with subprocess on Windows Tim Golden <mail@timgolden.me.uk> - 2014-05-28 06:08 +0100
        Re: Command prompt not shown when running Python script with subprocess on Windows ps16thypresenceisfullnessofjoy@gmail.com - 2014-05-28 13:22 -0700
      Re: Command prompt not shown when running Python script with subprocess on Windows Tim Golden <mail@timgolden.me.uk> - 2014-05-28 20:46 +0100
        Re: Command prompt not shown when running Python script with subprocess on Windows ps16thypresenceisfullnessofjoy@gmail.com - 2014-05-28 13:46 -0700
          Re: Command prompt not shown when running Python script with subprocess on Windows Tim Golden <mail@timgolden.me.uk> - 2014-05-29 12:41 +0100
            Re: Command prompt not shown when running Python script with subprocess on Windows ps16thypresenceisfullnessofjoy@gmail.com - 2014-05-29 12:21 -0700
              Re: Command prompt not shown when running Python script with subprocess on Windows Tim Golden <mail@timgolden.me.uk> - 2014-06-01 17:31 +0100
                Re: Command prompt not shown when running Python script with subprocess on Windows ps16thypresenceisfullnessofjoy@gmail.com - 2014-06-04 13:25 -0700

csiph-web