import osos.chdir('要设置的当前目录') >>> import os >>> os.getcwd() 'D:\\Python27' >>> os.chdir('d:\\aa') >>> os.getcwd() 'd:\\aa'