views:

71

answers:

2

how to create a temporary directory and get the path / file name in python

+4  A: 

Use the mkdtemp() function from the tempfile module:

import tempfile
dirpath = tempfile.mkdtemp()
Philipp
+2  A: 

Use module tempfile.

msw