Question: import subprocess, StringIO input = StringIO.StringIO("abcdefgh\nabc\n") # I don't know of a compact, evocative, and # cross-platform way to exhibit this behavior. # For now, depend on cat(1). p = subprocess.Popen(["cat"], stdout = subprocess.PIPE, stdin = response)
Why this is a question: A. it tosses an AttributeError. B. I *expected* it to do the equivalent of cat << HERE abcdefgh abc HERE In <URL: http://docs.python.org/dev/lib/node530.html >, I read "Valid values are ... an existing file object ..." Even though StringIO is a "file-like object", it lacks a fileno. Is there a way to get what I'm after? -- http://mail.python.org/mailman/listinfo/python-list