赞
踩
语法: 'sep'.join(seq)
参数说明
语法: os.path.join(path1[,path2[,......]])
返回值:将多个路径组合后返回
- >>> seq1 = ['hello','good','boy','doiido']
- >>> print ' '.join(seq1)
- hello good boy doiido
- >>> print ':'.join(seq1)
- hello:good:boy:doiido
- >>> seq2 = "hello good boy doiido"
- >>> print ':'.join(seq2)
- h:e:l:l:o: :g:o:o:d: :b:o:y: :d:o:i:i:d:o
- >>> seq3 = ('hello','good','boy','doiido')
- >>> print ':'.join(seq3)
- hello:good:boy:doiido
- >>> seq4 = {'hello':1,'good':2,'boy':3,'doiido':4}
- >>> print ':'.join(seq4)
- boy:good:doiido:hello
- >>> import os
- >>> os.path.join('/hello/','good/boy/','doiido')
- '/hello/good/boy/doiido'
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。