python how to change dir to c:\ code example Example: change directory in python script os.chdir(os.path.dirname(__file__))