class documentation
with InfolderGoneWithTheWind(): ... executes the block in a
temporary folder under the current folder. The temporary folder is deleted on exiting the block.
>>> import os >>> dir_ = os.getcwd() # for the record >>> len_ = len(os.listdir('.')) >>> with InfolderGoneWithTheWind(): # doctest: +SKIP ... # do some work in a folder here, e.g. write files ... len(dir_) > len(os.getcwd()) and os.getcwd() in dir_ True >>> # magically we are back in the original folder >>> assert dir_ == os.getcwd() >>> assert len(os.listdir('.')) == len_
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | __init__ |
no folder needs to be given |
Instance Variable | prefix |
Undocumented |
Instance Variable | root |
Undocumented |
Instance Variable | target |
Undocumented |
Instance Variable | _target |
Undocumented |