Python os.path.join() 进行路径拼接

Posted lowmanisbusy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python os.path.join() 进行路径拼接相关的知识,希望对你有一定的参考价值。

在python 项目开发过程中,经常需要将获取到的路径进行拼接,

# os.path.join(path1,path2) 将两个路径拼接起来

os.path.join("/usr","/etc/conf")
>>>"/usr/etc/conf"

 

以上是关于Python os.path.join() 进行路径拼接的主要内容,如果未能解决你的问题,请参考以下文章