(mode='w+b', buffering=-1, encoding=None,
                       newline=None, suffix=None, prefix=None,
                       dir=None, delete=True, *, errors=None)
Create and return a temporary file.
    Arguments:
    'prefix', 'suffix', 'dir' -- as for mkstemp.
    'mode' -- the mode argument to io.open (default "w+b").
    'buffering' -- the buffer size argument to io.open (default -1).
    'encoding' -- the encoding argument to io.open (default None)
    'newline' -- the newline argument to io.open (default None)
    'delete' -- whether the file is deleted on close (default True).
    'errors' -- the errors argument to io.open (default None)
    The file is created as mkstemp() would do it.

    Returns an object with a file-like interface; the name of the file
    is accessible as its 'name' attribute.  The file will be automatically
    deleted when it is closed unless the 'delete' argument is set to False.
Create and return a temporary file.
    Arguments:
    'prefix', 'suffix', 'dir' -- as for mkstemp.
    'mode' -- the mode argument to io.open (default "w+b").
    'buffering' -- the buffer size argument to io.open (default -1).
    'encoding' -- the encoding argument to io.open (default None)
    'newline' -- the newline argument to io.open (default None)
    'delete' -- whether the file is deleted on close (default True).
    'errors' -- the errors argument to io.open (default None)
    The file is created as mkstemp() would do it.
Create and return a temporary file . Arguments : prefix suffix dir -- as for mkstemp . mode -- the mode argument to io . open ( default w + b ) . buffering -- the buffer size argument to io . open ( default - 1 ) . encoding -- the encoding argument to io . open ( default None ) newline -- the newline argument to io . open ( default None ) delete -- whether the file is deleted on close ( default True ) . errors -- the errors argument to io . open ( default None ) The file is created as mkstemp () would do it .
def NamedTemporaryFile(mode='w+b', buffering=-1, encoding=None,
                       newline=None, suffix=None, prefix=None,
                       dir=None, delete=True, *, errors=None):
    """Create and return a temporary file.
    Arguments:
    'prefix', 'suffix', 'dir' -- as for mkstemp.
    'mode' -- the mode argument to io.open (default "w+b").
    'buffering' -- the buffer size argument to io.open (default -1).
    'encoding' -- the encoding argument to io.open (default None)
    'newline' -- the newline argument to io.open (default None)
    'delete' -- whether the file is deleted on close (default True).
    'errors' -- the errors argument to io.open (default None)
    The file is created as mkstemp() would do it.

    Returns an object with a file-like interface; the name of the file
    is accessible as its 'name' attribute.  The file will be automatically
    deleted when it is closed unless the 'delete' argument is set to False.
    """

    prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)

    flags = _bin_openflags

    # Setting O_TEMPORARY in the flags causes the OS to delete
    # the file when it is closed.  This is only supported by Windows.
    if _os.name == 'nt' and delete:
        flags |= _os.O_TEMPORARY

    if "b" not in mode:
        encoding = _io.text_encoding(encoding)

    (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
    try:
        file = _io.open(fd, mode, buffering=buffering,
                        newline=newline, encoding=encoding, errors=errors)

        return _TemporaryFileWrapper(file, name, delete)
    except BaseException:
        _os.unlink(name)
        _os.close(fd)
        raise
def NamedTemporaryFile ( mode = 'w+b' , buffering = - 1 , encoding = None , newline = None , suffix = None , prefix = None , dir = None , delete = True , * , errors = None ) : prefix , suffix , dir , output_type = _sanitize_params ( prefix , suffix , dir ) flags = _bin_openflags # Setting O_TEMPORARY in the flags causes the OS to delete # the file when it is closed.  This is only supported by Windows. if _os . name == 'nt' and delete : flags |= _os . O_TEMPORARY if "b" not in mode : encoding = _io . text_encoding ( encoding ) ( fd , name ) = _mkstemp_inner ( dir , prefix , suffix , flags , output_type ) try : file = _io . open ( fd , mode , buffering = buffering , newline = newline , encoding = encoding , errors = errors ) return _TemporaryFileWrapper ( file , name , delete ) except BaseException : _os . unlink ( name ) _os . close ( fd ) raise