python如何设置路径

图片[1]-python如何设置路径-uusu优素-乐高,模型,3d打印,编程

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

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

默认路径为:

>>>importos
>>>os.getcwd()
'D:\\ProgramFiles\\Python35
>>>os.chdir("D:\ProgramFiles\Python35\modifyPath\test02")
>>>os.getcwd()
'D:\\ProgramFiles\\Python35\\modifyPath\\test02
原文来自:https://www.py.cn
© 版权声明
THE END
喜欢就支持一下吧
点赞11 分享