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
相關文章
相關標籤/搜索