在python中如何设置当前工作目录 import osos.chdir('要设置的当前目录') >>> import os >>> os.getcwd() 'D:\Python27' >>> os.chdir('d:\aa') >>> os.getcwd() 'd:\aa'