Home · Quickstart · User Guide and Examples · Interfaces Index · Developers · About · Nipy

# nipype.utils.tmpdirs module

class nipype.utils.tmpdirs.InTemporaryDirectory(suffix='', prefix='tmp', dir=None)

  Bases: `nipype.utils.tmpdirs.TemporaryDirectory`

class nipype.utils.tmpdirs.TemporaryDirectory(suffix='', prefix='tmp', dir=None)

  Bases: `object`

  Create and return a temporary directory. This has the same behavior as mkdtemp but can be used as a context manager. For example:

  > with TemporaryDirectory() as tmpdir:

  >   …

  Upon exiting the context, the directory and everthing contained in it are removed.

  cleanup()