On this page
  1. tempfile.gettempdir
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

tempfile.gettempdir

Up: tempfile | Next: tempfile.gettempdirb
Rel: tempfile.gettempdirb, tempfile.gettempprefix, tempfile.gettempprefixb, tempfile.mkdtemp
Ref: docs.python.org — tempfile.gettempdir
Tags: #public #python3 #stdlib #tempfile


Import

import tempfile
from tempfile import gettempdir

Signature & Overview

tempfile.gettempdir()

Returns tempfile.tempdir as str.

Usage

from pathlib import Path
import tempfile

tmp_root = Path(tempfile.gettempdir())
assert tmp_root.is_dir()

Gotchas

REPL Inspect

from tempfile import gettempdir
help(gettempdir)

Linked from

Related notes