How to set the current working directory?


Question

How to set the current working directory in Python?

1
481
10/25/2017 9:55:46 PM

Accepted Answer

Try os.chdir

os.chdir(path)

        Change the current working directory to path. Availability: Unix, Windows.

718
2/13/2013 10:43:35 AM

Perhaps this is what you are looking for:

import os
os.chdir(default_path)

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon