您现在的位置是:课程教程文章

python如何设置路径

2023-12-18 22:54课程教程文章 人已围观

改变python的默认路径为当前的工作路径

通过os模块来进行python中路径的更改

默认路径为:

>>> import os
>>> os.getcwd()

'D:\\Program Files\\Python35

跳转到当前工作路径为

>>> os.chdir("D:\Program Files\Python35\modifyPath\test02")
>>> os.getcwd()

'D:\\Program Files\\Python35\\ modifyPath \\ test02
课程教程:python如何设置路径

上一篇:python怎么比较字符串是否相等

下一篇:没有了

站点信息

  • 文章统计篇文章