我有一个关于python的代码,但它不起作用。 文件.seek(0)应该指向文件的开头;但它只指向行的开头一次
import smart_open
i=0
with smart_open.smart_open('s3://bkprav1/att1.txt','r') as fin1,smart_open.smart_open('s3://bkprav1/att2_ch2.txt','r') as fin2:
for line1 in fin1:
i=i+1
print(i)
print("line1")
print(line1)
j=0
for line2 in fin2:
j=j+1
print(j)
print("line2")
print(line2)
fin2.seek(0)
目前没有回答
相关问题 更多 >
编程相关推荐