Understanding tempfile.TemporaryFile

byte8bits at gmail.com byte8bits at gmail.com
Thu Dec 27 22:29:09 EST 2007


On Dec 27, 10:12 pm, John Machin <sjmac... at lexicon.net> wrote:

> Check out the seek method.

Ah yes... thank you:

>>> import tempfile
>>> x = tempfile.TemporaryFile()
>>> x.write("test")
>>> print x.read()

>>> x.seek(0)
>>> print x.read()
test





More information about the Python-list mailing list