Os change working directory python code example
Example 1: setwd python
os.chdir("/home/varun/temp")
Example 2: change directory in python os
import os
path = "C:\Users\Your\Directory"
os.chdir(path)
Example 3: change working directory python
import os
os.chdir(new_working_directory)
Example 4: python change working directory to file directory
import os
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname)