@contextmanager
def temporary_folder():
 tempdir = mkdtemp()
 try:
  (yield tempdir)
 finally:
  rmtree(tempdir)

@ contextmanager def temporary_folder ( ) : tempdir = mkdtemp ( ) try : ( yield tempdir ) finally : rmtree ( tempdir )
creates a temporary folder .