Module rfc822 - uses file-objects - why?
William Annis
annis at biostat.wisc.edu
Thu Feb 22 12:53:03 EST 2001
Thomas Volkmar Worm <worm at gdp-group.com> writes:
> Do I need to store every list/string
> onto disk when I want to use these classes or methods on them?
>
> To solve the problem I started to write a helper class which implements
> methods like readline for my objects, but I really do not want to write
> an emulation of the file-class again and again for each object I create.
You have solved a problem other people have had and solved
already. The StringIO class -- part of standard Python -- can be used
to make strings act like files:
http://www.python.org/doc/current/lib/module-StringIO.html
--
William Annis - System Administrator - Biomedical Computing Group
annis at biostat.wisc.edu PGP ID:1024/FBF64031
Mi parolas Esperanton - La Internacian Lingvon www.esperanto.org
More information about the Python-list
mailing list