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


Groups > comp.lang.python > #72102

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

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
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; 'executable': 0.09; 'input,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:script': 0.09; 'windows,': 0.09; 'runs': 0.10; 'python': 0.11; 'gui': 0.12; 'wrote': 0.14; 'windows': 0.15; 'default),': 0.16; 'file).': 0.16; 'given,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject: \n ': 0.16; 'subject:when': 0.16; 'wxpython': 0.16; 'trying': 0.19; 'skip:p 40': 0.19; 'written': 0.21; '(the': 0.22; 'command': 0.22; 'input': 0.22; 'error': 0.23; 'keyboard': 0.24; 'specify': 0.24; 'script': 0.25; 'shown': 0.26; 'gets': 0.27; 'header:X-Complaints-To:1': 0.27; 'tried': 0.27; 'related': 0.29; '(my': 0.31; 'correctly.': 0.31; "user's": 0.31; 'file': 0.32; 'run': 0.32; 'open': 0.33; 'problem': 0.35; 'subject:with': 0.35; 'problem.': 0.35; 'but': 0.35; 'there': 0.35; 'application': 0.37; 'list': 0.37; 'to:addr:python-list': 0.38; 'files': 0.38; 'fact': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'users': 0.40; "you're": 0.61; 'more': 0.64; 'prompt': 0.68; 'silently': 0.84; 'timothy': 0.84; 'subject::': 0.85
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dave Angel <davea@davea.name>
Subject Re:Command prompt not shown when running Python script with subprocess on Windows
Date Tue, 27 May 2014 03:20:40 -0400 (EDT)
Organization news.gmane.org
References <29c26176-b573-4ac9-bf41-a18a53d7dfb9@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host dpc6744199209.direcpc.com
X-Newsreader PiaoHong.NewsGroup.Client.VIP:1.52
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.10361.1401175238.18130.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1401175238 news.xs4all.nl 2878 [2001:888:2000:d::a6]:58675
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:72102

Show key headers only | View raw


ps16thypresenceisfullnessofjoy@gmail.com Wrote in message:
> 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
> 

If you want to use shell=False, you need to specify the executable
 correctly.  Since you're on Windows,  the executable is named
 python.exe, not myscript. py

If you still get errors,  you need to get a lot more explicit. 
 Copy/paste, not paraphrase. 

-- 
DaveA

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