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