chdir

Contents

chdir#

chdir(newdir: str | CloudPath | Path) None[source]#

Change current directory, used as a context manager, i.e.:

Parameters:

newdir (str) – New directory

Example

>>> folder = r"C:/"
>>> with chdir(folder):
>>>     print(os.getcwd())
'C:/'