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