1,文本内容如图一:
文件内容2,程序代码
with open('rizhi.txt')as f:
contents = f.read()
a_list1 = []
t = contents.replace('\n',',')
x = t.split(',')
for rin x:
href ='https://www.amazon.com/dp/{0}'.format(r)
print(href)
with open('rizhi.txt')as f:
contents = f.read()
a_list1 = []
t = contents.replace('\n',',')
x = t.split(',')
for rin x:
href ='https://www.amazon.com/dp/{0}'.format(r)
print(href)
本文标题:从文本中取出内容拼接
本文链接:https://www.haomeiwen.com/subject/wkbcgftx.html
网友评论