tempfile.gettempdir() result on Windows

Leo Breebaart leo at lspace.org
Fri Jun 3 11:34:23 EDT 2005


On MS Windows, I am trying to find out a good default location to
save some temporary files.

The tempfile module seemed to have exactly what I wanted:

>>> import tempfile
>>> tempfile.gettempdir()
'c:\\docume~1\\admini~1\\locals~1\\temp'
>>>

My problem (entirely cosmetic, but still) is that I also need to
show this location to the users of my program, who I suspect
would be much happier with a 'proper' Windows path than with this
'~1' DOS malarkey.

Does anybody know how I can obtain a temp directory in 'verbose'
format (or somehow convert the gettempdir() result to that)?

-- 
Leo Breebaart  <leo at lspace.org>



More information about the Python-list mailing list