The tempfile module is used to generate temporary filenames and files.
mkdtemp([suffix [,prefix [,dir]]])
Creates a temporary directory accessible only by the owner of the calling process and returns its absolute pathname. suffix is an optional suffix that will be appended to the directory name, prefix is an optional prefix that will be inserted at the beginning of the directory name, and dir is a directory where the temporary directory should be created.
mkstemp([suffix [,prefix [, dir [,text]]]])
Creates a temporary file and returns a tuple (fd, pathname) where fd is an integer file descriptor returned by os.open() and pathname is absolute pathname of the file. suffix is an optional suffix appended to the filename, prefix is an optional ...