python temp directory

Solutions on MaxInterview for python temp directory by the best coders in the world

showing results for - "python temp directory"
Lya
24 Sep 2018
1Use the mkdtemp() function from the tempfile module:
2
3import tempfile
4import shutil
5
6dirpath = tempfile.mkdtemp()
7# ... do stuff with dirpath
8shutil.rmtree(dirpath)