Skip to content

Instantly share code, notes, and snippets.

@hngkr
Created July 12, 2019 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hngkr/37d57028c7beb7c9ded570a4ab4c0307 to your computer and use it in GitHub Desktop.
Save hngkr/37d57028c7beb7c9ded570a4ab4c0307 to your computer and use it in GitHub Desktop.
tempfile.TemporaryDirectory example
with tempfile.TemporaryDirectory() as workdir:
project_dirname = "project"
project_dir = os.path.join(workdir, project_dirname)
os.mkdir(project_dir)
# do esoteric work within that temporary workdir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment