TempSimuDir¶
- class TempSimuDir(res_dir, prefix='simu_', cleanup=False, to_be_copied=None)¶
Implement a context manager that creates a temporary working directory.
Create a temporary working directory on res_dir preceded by prefix and clean up at the exit if necessary.
- Parameters:
- res_dirstr
Path where the temporary working directory will be created.
- prefixstr (optional)
String that preceeds the directory name.
- cleanupbool (optional)
If True erase the directory and its children at the exit.
- to_be_copiedlist (optional)
List of files or folders to transfer to the temporary working directory