libb.cd

cd(path)[source]

Context manager to safely change working directory.

Restores original directory when context exits.

Parameters:

path – Directory to change to.

Example:

with cd("/some/folder"):
    run_command("some_command")