tempfile.gettempdir()
Return the name of the directory used for temporary files. This defines the default value for the dir argument to all functions in this module.
Python searches a standard list of directories to find one which the calling user can create files in. The list is:
- The directory named by the
TMPDIR
environment variable. - The directory named by the
TEMP
environment variable. - The directory named by the
TMP
environment variable. - A platform-specific location:
- On Windows, the directories
C:\TEMP
,C:\TMP
,\TEMP
, and\TMP
, in that order. - On all other platforms, the directories
/tmp
,/var/tmp
, and/usr/tmp
, in that order.
- On Windows, the directories
- As a last resort, the current working directory.
The result of this search is cached, see the description of tempdir
below.
Please login to continue.