yibeimingyue
def join(self, iterable): # real signature unknown; restored from __doc__
"""
S.join(iterable) -> str

Return a string which is the concatenation of the strings in the
iterable. The separator between elements is S.
"""

上面是库函数的定义:可以看到join()函数的参数要求是一个可迭代对象,比如说:

1.字符串

2.列表

3.元组

join()函数返回一个字符串,这个字符串是可迭代对象(即它的参数)中各个元素的结合,这个结合是以字符S为分隔符的。

 

from os.path import join
d=\'/media/dell/D\'
e=\'123.txt\'
f=join(d,e)

结果是:

\'/media/dell/D/123.txt\'
自己会加上反斜杠

 

 

from os.path import join

分类:

技术点:

相关文章:

  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
猜你喜欢
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
相关资源
相似解决方案