Python 修改当前工作的路径

Python 修改当前工作的路径

 

当前目录

c = os.getcwd()

 

返回上级目录

cu = os.path.abspath(os.path.join(os.getcwd(), ".."))
os.chdir(cu)

并修改目录

posted @ 2020-05-26 09:49  bH1pJ  阅读(126)  评论(0编辑  收藏  举报