chdir context manager

/ Published in: Python
Save to your folder(s)

This context manager restores the value of the current working directory (cwd) after the enclosed code block completes or raises an exception. If a directory name is supplied to the context manager then the cwd is changed prior to running the code block.


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.