On 6/16/10 1:29 PM, Brandon McGinty wrote: > Both subprocess and os.popen* only allow inputput and output one time, > and the output to be read only when the process terminates.
Its not that subprocess only *allow* input and output one at a time, but that it a) provides blocking file objects by default, and b) those only read until EOF. It also provides *convenience* methods for the common case of writing output once and receiving everything back, but that's not the only way you can use it. If you want a bidirectional write/read for awhile, you really just need to switch those file objects to non-blocking and such. I found this useful when I needed to do it: http://code.activestate.com/recipes/440554/ -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/
signature.asc
Description: OpenPGP digital signature
-- http://mail.python.org/mailman/listinfo/python-list