import os abspath = os.path.abspath(__file__) dname = os.path.dirname(abspath) os.chdir(dname)
import os os.chdir(new_working_directory)
>>> os.chdir('C:Python33') >>> print(os.getcwd()) C:Python33