Han-Gang / test

test
0 stars 0 forks source link

python逐行读取文件最快 #35

Open Han-Gang opened 5 years ago

Han-Gang commented 5 years ago
file_object = open('test.txt','rU')
try: 
    for line in file_object:
         do_somthing_with(line)  # the line with "\n"
finally:
     file_object.close()