[Python-Dev] r87010 - in python/branches/py3k: Doc/library/subprocess.rst Lib/subprocess.py Lib/test/test_subprocess.py

skip at pobox.com skip at pobox.com
Sun Dec 5 19:03:33 CET 2010


    Glenn> On 12/4/2010 3:07 PM, Paul Moore wrote:
    >> The original goal was for subprocess to replace os.system, os.popen,
    >> os.spawn, etc. That's never quite happened because subprocess is just
    >> a little bit too conceptually complex for those basic tasks.

    Glenn> Is that way?  I didn't find it particularly hard to learn, given
    Glenn> the "cheat sheet" of techniques for doing the replacements.

For 99% of my usage (I suspect for most other peoples' as well, at least on
Unix-y systems), this is all I need:

    for line in os.popen("some pipeline"):
        do_stuff(line)

No cheat sheet necessary.  I don't see how subprocess could have made that
common idiom any simpler.  Maybe it's better at doing esoteric stuff,
however that falls into the 1% where a simple os.popen isn't adequate.

Skip


More information about the Python-Dev mailing list