File object wrapper for a String?
David Erickson
halcyon1981 at gmail.com
Thu Feb 14 18:25:02 EST 2008
More information about the Python-list mailing list
Thu Feb 14 18:25:02 EST 2008
- Previous message (by thread): File object wrapper for a String?
- Next message (by thread): Please help help ..... for threading
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Feb 14, 3:07 pm, Christian Heimes <li... at cheimes.de> wrote: > David Erickson wrote: > > I am using the Popen class from subprocess and would like to feed a > > string in as the stdin parameter, however primarily it only takes a > > File object. Does there exist a wrapper for a string to do this? I > > know I can just dump the string to a temp file and feed that in but > > that is pretty hacky. > > You don't need a file like object: > > popen = subprocess.Popen(..., stdin=subprocess.PIPE) > popen.stdin.write("yourstring") > > Christian Perfect. Thanks. -David
- Previous message (by thread): File object wrapper for a String?
- Next message (by thread): Please help help ..... for threading
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list