• 技术文章 >常见问题 >Python常见问题

    python如何设置路径

    (*-*)浩(*-*)浩2019-08-30 13:26:03原创14931

    改变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怎么输出换行 下一篇:python怎么比较字符串是否相等

    相关文章推荐

    • python用install失败怎么解决• python判断键在不在字典里• 如何卸载python

    全部评论我要评论

    © 2021 Python学习网 苏ICP备2021003149号-1

  • 取消发布评论
  • 

    Python学习网