[Python-ideas] shutil.runret and shutil.runout
Matt Joiner
anacrolix at gmail.com
Sun Feb 26 12:59:17 CET 2012
I strongly suspect such 3rd party library exists.
On Feb 26, 2012 7:49 PM, "Serhiy Storchaka" <storchaka at gmail.com> wrote:
> 24.02.12 14:41, Nick Coghlan написав(ла):
> > On Fri, Feb 24, 2012 at 10:13 PM, Mike Meyer<mwm at mired.org> wrote:
> >> Oddly enough, I read the Julia docs on external commands between my
> >> first answer and your reply, and their solution is both as simple as
> >> what you want, and safe.
>
> Yes, I want this in Python:
>
> readall(cmd('cut -d: -f3 $file', file='/etc/passwd') | cmd('sort -n') |
> cmd('tail -n5'))
>
> or
>
> cmd('cut', '-d:', '-f3', '/etc/passwd').pipe('sort', '-n').pipe('tail',
> '-n5').readlines()
>
> or something similar.
>
> > That *is* rather nice, although they never get around to actually
> > explaining *how* to capture the output from the child processes
> > (http://julialang.org/manual/running-external-programs/, for anyone
> > else that's interested).
>
>
> https://github.com/JuliaLang/julia/blob/10aabddc3834223568a87721149d05765e7e9997/j/process.j
> See readall and each_line.
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20120226/32bea332/attachment.html>
More information about the Python-ideas
mailing list