[Tutor] Avoiding the use of files to store intermediate results

Hugo González Monteverde hugonz-lists at h-lab.net
Tue Apr 25 05:09:48 CEST 2006

Remember duck typing. An object just needs to look like a file in order 
to be used like one.

Guido's time machine has already forseen your problem. Take a look at 
the StringIO module.  It allows you to use a string where you would 
normally pass a file object.

Hope that helps,


> ######
> While this works, I find it "messy", as it creates some intermediate
> files.  I was wondering if there was a better way to do things all in
> memory, in an OS independent way.
> [Note that the complete application is approximately 665 lines long
> ... a bit too much
> to post all here :-)]
> André
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

More information about the Tutor mailing list