如何设置当前工作目录?

如何在Python中设置当前工作目录?



慕少森
浏览 832回答 4
4回答

ibeautiful

也许这就是您要寻找的:import osos.chdir(default_path)

慕标5832272

import osprint os.getcwd()  # Prints the current working directory设置工作目录:os.chdir('c:\\Users\\uname\\desktop\\python')  # Provide the new path here

皈依舞

它工作的Mac也import ospath="/Users/HOME/Desktop/Addl Work/TimeSeries-Done"os.chdir(path)检查工作目录os.getcwd()
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python