那将是tempfile模块。
它具有获取临时目录的功能,还具有一些在其中创建命名或未命名临时文件和目录的快捷方式。
例:
import tempfile
print tempfile.gettempdir() # prints the current temporary directory
f = tempfile.TemporaryFile()
f.write('something on temporaryfile')
f.seek(0) # return to beginning of file
print f.read() # reads data back from the file
f.close() # temporary file is automatically deleted here
为了完整起见,以下是根据文档搜索临时目录的方式: