Multiple calls to /dev/stdin using python subprocess (*nix)

Posted by Alex Leach on Stack Overflow See other posts from Stack Overflow or by Alex Leach
Published on 2011-01-09T22:41:19Z Indexed on 2011/01/09 22:53 UTC
Read the original article Hit count: 190

Filed under:
|
|

Hi, I have a python subprocess call which I would like to link up to three pipes (two standard in and one standard out). I know that there is only one /dev/stdin, but there's all those other devices in /dev I don't know about, and don't know of any python os, sys or subprocess modules that will utilise them in a manner which allows me to give the device path to subprocess.Popen.
The reason I ask is because I would like to pipe information from a mysql database or tar archive rather than a directory structure I currently have which has >28,000 directories in. The directory names alone uses a LOT of space! The alternative is to tar / gunzip the entire directory structure and manoeuvre through the compressed archive. With either solution, mysql or tar, I would still like to have two pipes into subprocess.Popen and one out, so that I can bypass the HDD.
Any need for an example??

© Stack Overflow or respective owner

Related posts about python

Related posts about pipes