This question already has an answer here:
(这个问题在这里已有答案:)
(如何在Python中更改目录(cd)?)
(13个答案)
How to set the current working directory in Python?
(如何在Python中设置当前工作目录?)
Try os.chdir
os.chdir
(尝试os.chdir)
os.chdir(path) Change the current working directory to path. (将当前工作目录更改为路径。)Availability: Unix, Windows. (可用性:Unix,Windows。)
os.chdir(path)
Change the current working directory to path.
(将当前工作目录更改为路径。)
(可用性:Unix,Windows。)
2.1m questions
2.1m answers
60 comments
57.0k users