Getting subprocess.call() output into a string?

David wizzardx at gmail.com
Tue Apr 15 17:16:01 EDT 2008


>
>  Still, about StringIO...
>

The module description says you can use it to read and write strings
as files, not that you can use strings *everywhere* you can use files.

In your specific case, StringIO doesn't work, because the stdout
redirection takes place at the operating system level (which uses real
file handles), rather than in a python library (for which StringIO
would probably work).

David.



More information about the Python-list mailing list