How to create temp file in memory???

Diez B. Roggisch deets at nospam.web.de
Wed Oct 5 17:24:20 CEST 2005


Wenhua Zhao wrote:
> I have a list of lines. I want to feed these lines into a function.
> The input of this function is a file.
> I want to creat a temp file on disk, and write the list of lines into 
> this temp file, then reopen the file and feed it to the function.
> Can I create a this temp file on memory???

Yes, the answer has been given to yoou already: (c?)StringIO will help you.

Diez



More information about the Python-list mailing list