File object wrapper for a String?

David Erickson halcyon1981 at gmail.com
Thu Feb 14 18:25:23 EST 2008


On Feb 14, 3:16 pm, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> David Erickson schrieb:
>
> > 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.
>
> Christian told you how to work with popen. Just for the record thogh:
> there are the StringIO and cStringIO-modules.
>
> Diez

Good to know, thanks Diez.

-David



More information about the Python-list mailing list