Created
July 12, 2019 22:01
-
-
Save hngkr/37d57028c7beb7c9ded570a4ab4c0307 to your computer and use it in GitHub Desktop.
tempfile.TemporaryDirectory example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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