file and directory handling namedtemporaryfile([mode [bufsize [suffix [,prefix [dir [delete ]]]]]]creates temporary file just like temporaryfile(but makes sure the filename is visible on the file system the filename can be obtained by accessing the name attribute of the returned file object note that certain systems may prevent the file from being reopened using this name until the temporary file has been closed the delete parameterif set to true (the default)forces the temporary file to be deleted as soon as it is closed spooledtemporaryfile([max_size [mode [bufsize [suffix [prefix [dir]]]]]]creates temporary file such as temporaryfile except that the file contents are entirely held in memory until they exceed the size given in max_size this internal spooling is implemented by first holding the file contents in stringio object until it is necessary to actually go to the file system if any kind of low-level file / operation is performed involving the fileno(methodthe memory contents are immediately written to proper temporary file as defined by the temporaryfile object the file object returned by spooledtemporaryfile also has method rollover(that can be used to force the contents to be written to the file system two global variables are used to construct temporary names they can be assigned to new values if desired their default values are system-dependent variable description tempdir template the directory in which filenames returned by mktemp(reside the prefix of filenames generated by mktemp( string of decimal digits is added to template to generate unique filenames note by defaultthe tempfile module creates files by checking few standard locations for exampleon unixfiles are created in one of /tmp/var/tmpor /usr/tmp on windowsfiles are created in one of :\tempc:\tmp\tempor \tmp these directories can be overridden by setting one or more of the tmpdirtempand tmp environment variables iffor whatever reasontemporary files can' be created in any of the usual locationsthey will be created in the current working directory zipfile the zipfile module is used to manipulate files encoded in the popular zip format (originally known as pkzipalthough now supported by wide variety of programszip files are widely used by pythonmainly for the purpose of packaging for exampleif zip files containing python source code are added to sys paththen files contained within the zip file can be loaded via import (the zipimport library module implements this functionalityalthough it' never necessary to use that library directlypackages distributed as egg files (created by the setuptools extensionare also just zip files in disguise (an egg file is actually just zip file with some extra metadata added to itf lib fl ff