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


Groups > comp.lang.python > #77388

Re: subprocess module usage

References <CAPrJNb4_m-1sqwzUcqnHR6jTFo-Tp=a1hLgTvXrujXW5sAUkpg@mail.gmail.com>
Date 2014-09-01 13:55 +1000
Subject Re: subprocess module usage
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.13678.1409543719.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Sep 1, 2014 at 1:28 PM, Earl Lapus <earl.lapus@gmail.com> wrote:
> So, what could be causing this behavior? Is this expected or is there
> something wrong with how I'm using the subprocess module?

The latter. Your problem is with your shell= option.

Firstly, the parameter should be either shell=True or shell=False, not
shell="True". However, I don't believe that's making any difference
here (although shell="False" would act as shell=True, and confuse you
greatly).

But secondly, you're already splitting the argument (or rather, taking
it from your own parameters, already split), so you don't want to go
through the shell. In fact, going through the shell would only make
your life harder. Change that to shell=False and you'll see everything
work.

Meta-comment: Rather than attaching your code, please just include it
in-line. It's much easier to work with - especially when I want to
quote a line and respond to it. Thanks!

ChrisA

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


Thread

Re: subprocess module usage Chris Angelico <rosuav@gmail.com> - 2014-09-01 13:55 +1000

csiph-web