digraph inheritance51a171db78 { rankdir=LR; ratio=compress; fontsize=14; size="6.0, 8.0"; "TemporaryDirectory" [shape=ellipse,URL="#nibabel.tmpdirs.TemporaryDirectory",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; }
Create and return a temporary directory. This has the same behavior as mkdtemp but can be used as a context manager.
Upon exiting the context, the directory and everthing contained in it are removed.
Examples
>>> import os
>>> with TemporaryDirectory() as tmpdir:
... fname = os.path.join(tmpdir, 'example_file.txt')
... with open(fname, 'wt') as fobj:
... _ = fobj.write('a string\n')
>>> os.path.exists(tmpdir)
False