09 os.path.join 路径的拼接

os.path.join 路径的拼接
import os
path = "D:\code\s21day14" # user/index/inx/fasd/
v = 'n.txt'

result = os.path.join(path,v)
print(result)
result = os.path.join(path,'n1','n2','n3')
print(result)
posted @ 2024-09-26 22:45  jhchena  阅读(2)  评论(0编辑  收藏  举报