>>> import os >>> os.getcwd() 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37' >>> os.chdir('D:\\') >>> os.getcwd() 'D:\\'