def mktemp(suffix='', prefix=template, dir=None):
 if (dir is None):
  dir = gettempdir()
 names = _get_candidate_names()
 for seq in range(TMP_MAX):
  name = next(names)
  file = _os.path.join(dir, ((prefix + name) + suffix))
  if (not _exists(file)):
   return file
 raise FileExistsError(_errno.EEXIST, 'No usable temporary filename found')

def mktemp ( suffix = '' , prefix = template , dir = None ) : if ( dir is None ) : dir = gettempdir ( ) names = _get_candidate_names ( ) for seq in range ( TMP_MAX ) : name = next ( names ) file = _os . path . join ( dir , ( ( prefix + name ) + suffix ) ) if ( not _exists ( file ) ) : return file raise FileExistsError ( _errno . EEXIST , 'No usable temporary filename found' )
user-callable function to return a unique temporary file name .