Here is a small wrapper around tempfile.mkdtemp to automatically manage files and directories created within a temporary directory. Documentation is included.
import tempdir with tempdir.TempDir() as t: # do stuff pass # t (and everything within) is gone t = tempdir.TempDir() # do stuff t.dissolve()
It is mainly intended for testing software that needs a working area, think openldap or neo4j.
tox makes me believe it runs with python 2.5 through 3.1 Comments, improvements and suggestions welcome