Python如何获取、切换当前工做目录?

场景:要把/Users/huxinguang/Downloads/demo下的test2.txt文件名改为test5.txt,发如今import os后直接调用os.rename(‘test2.txt’,’test5.txt’)会报错web 用os.getcwd()方法获取Python的当前工做目录(getcwd是get current work directory的缩写)svg 而test2.t
相关文章
相关标签/搜索