how to change directory in for loop in python code example Example: setwd python os.chdir("/home/varun/temp")