其他分享
首页 > 其他分享> > os.path.join的用法--拼写路径

os.path.join的用法--拼写路径

作者:互联网

import os

Path1 = ‘home’
Path2 = ‘develop’
Path3 = ‘code’

Path10 = Path1 + Path2 + Path3
Path20 = os.path.join(Path1,Path2,Path3)
print ('Path10 = ',Path10)
print ('Path20 = ',Path20)

输出

Path10 = homedevelopcode
Path20 = home\develop\code

标签:Path2,Path3,Path1,join,Path10,--,Path20,path,os
来源: https://blog.csdn.net/qq_34595138/article/details/113426655