This is probably the most common first use case someone has when trying to
use subprocess for the first time and I think it has always been a bit of a
wart that, given all the helpers and wrappers the subprocess module already
has, it lacks one for that very obvious and common need.
Yes, run()
Let’s please leave this alone. As Serhiy says run() covers everything.
On Thu, Apr 4, 2019 at 3:03 AM Oleg Broytman wrote:
> On Thu, Apr 04, 2019 at 07:44:29PM +1100, Chris Angelico
> wrote:
> > On Thu, Apr 4, 2019 at 7:12 PM Nathaniel Smith wrote:
> > >
> > > On Thu, Apr 4, 2019 at 12:48 AM
On Thu, Apr 04, 2019 at 07:44:29PM +1100, Chris Angelico
wrote:
> On Thu, Apr 4, 2019 at 7:12 PM Nathaniel Smith wrote:
> >
> > On Thu, Apr 4, 2019 at 12:48 AM Greg Ewing
> > wrote:
> > >
> > > The check_output() function of the subprocess module raises an
> > > exception if the process
04.04.19 11:59, Greg Ewing пише:
Nathaniel Smith wrote:
On Thu, Apr 4, 2019 at 12:48 AM Greg Ewing
wrote:
output(args) --> (status, output)
Isn't this already available as: run(args, stdout=PIPE)?
Yes, but you need to do more than that to get the output
as a string. This is the relevant
On Thu, Apr 4, 2019 at 1:59 AM Greg Ewing wrote:
>
> Nathaniel Smith wrote:
> > On Thu, Apr 4, 2019 at 12:48 AM Greg Ewing
> > wrote:
> >>output(args) --> (status, output)
> >
> > Isn't this already available as: run(args, stdout=PIPE)?
>
> Yes, but you need to do more than that to get the
On Thu, Apr 4, 2019 at 8:02 PM Greg Ewing wrote:
>
> Chris Angelico wrote:
> > +1 on adding a nice simple function, although I'm not 100% sold on the
> > name "output".
>
> The idea is that output/check_output would go together like
> call/check_call.
>
Yeah, so I think that on balance it's
Chris Angelico wrote:
+1 on adding a nice simple function, although I'm not 100% sold on the
name "output".
The idea is that output/check_output would go together like
call/check_call.
--
Greg
___
Python-ideas mailing list
Python-ideas@python.org
Nathaniel Smith wrote:
On Thu, Apr 4, 2019 at 12:48 AM Greg Ewing wrote:
output(args) --> (status, output)
Isn't this already available as: run(args, stdout=PIPE)?
Yes, but you need to do more than that to get the output
as a string. This is the relevant part of the implementation
of
On Thu, Apr 4, 2019 at 7:12 PM Nathaniel Smith wrote:
>
> On Thu, Apr 4, 2019 at 12:48 AM Greg Ewing
> wrote:
> >
> > The check_output() function of the subprocess module raises an
> > exception if the process returns a non-zero exit status. This is
> > inconvenient for commands such as grep
On Thu, Apr 4, 2019 at 12:48 AM Greg Ewing wrote:
>
> The check_output() function of the subprocess module raises an
> exception if the process returns a non-zero exit status. This is
> inconvenient for commands such as grep that use the return
> status to indicate something other than success or
10 matches
Mail list logo