How to change working directory on Python

Manpreet Singh
2 min readFeb 26, 2021

Welcome back! A very common thing to do with Python for any project is changing the working directory. Changing the directory is very easy to do, there are only 3 requirements to change the directory:

1: The directory exists (the folder or file your linking to must exist)

2. You have access to the folder

3. You input the file directory right

Let’s get started! First off, to change the working directory it’s as easy as:

import os
os.chdir('folder/path/here')

--

--