tempfile.tempdir
tempfile.tempdir is a Python function in the Tempfile Module category. The path used for temporary files. Can be set to override the default. The syntax is tempfile.tempdir. Returns: String or None. A typical example: tempfile.tempdir = "/my/custom/tmp". A close sibling is tempfile.TemporaryFile(), which creates a temporary file that is automatically deleted when closed. A close sibling is tempfile.NamedTemporaryFile(), which creates a temporary file with a visible name in the filesystem. A close sibling is tempfile.mkstemp(), which creates a temporary file and returns a (fd, path) tuple. Caller must close and delete. A close sibling is tempfile.mkdtemp(), which creates a temporary directory that persists after creation. More about this category: Temporary file and directory creation — TemporaryFile, mkstemp, mkdtemp. Related Tempfile Module entries: tempfile.TemporaryFile(), tempfile.NamedTemporaryFile(), tempfile.mkstemp(), tempfile.mkdtemp(), tempfile.TemporaryDirectory(), tempfile.gettempdir(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details.