os.tmpfile()

Erik Max Francis max at alcyone.com
Tue Jan 1 23:40:16 EST 2008


jyoung79 at kc.rr.com wrote:

> Can anyone elaborate on how 'os.tmpfile()' works?  I was thinking it would create some sort of temporary file I could quickly add text too and then when I was finished would automatically get rid of it.  Here's my questions:
	...
> Can you actually 'write' to this file?  And if so, do you have to 'close()' it when you're done with it?  Thanks for your help with this...  I'm still learning Python and haven't been able to find out much about this in the documentation or on-line.

It's a file.  You read strings from it and write strings to it.  It 
isn't a string itself.  Given that what you're trying to do doesn't make 
any sense, it's hard to know where to begin to identify what's confusing 
you.

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
  San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis
   And though the odds say improbable / What do they know
    -- Stevie Wonder



More information about the Python-list mailing list