Hacker News new | past | comments | ask | show | jobs | submit login

I haven't run it but I'm quite sure you can do this to get direct pipe without having to run foo to completion before starting bar:

    foo = subprocess.Popen(['foo'], stdout=subprocess.PIPE)
    bar_output = subprocess.check_output(['bar'], stdin=foo.stdout)  
Though the idea with python is that you shouldn't have to do as much piping as you do in bash, no need for xargs, cut, find, etc. Just process the data inside python code. So the pain of having to use two lines instead of a | isn't as big as many people claim.



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: