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
2023-11-17 20:54:52
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