文件搜索smart_open无法正常工作

时间:2017-06-13 10:48:31

标签: python

我在python上有一个代码,但是没有用。 file.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)

0 个答案:

没有答案