how to change directory python import patj code example Example 1: setwd python os.chdir("/home/varun/temp") Example 2: how to change os path in python os.chdir(path)