📅  最后修改于: 2022-03-11 14:45:51.005000             🧑  作者: Mango
Use the mkdtemp() function from the tempfile module:
import tempfile
import shutil
dirpath = tempfile.mkdtemp()
# ... do stuff with dirpath
shutil.rmtree(dirpath)