def some_condition(line): return "ddd" in line with open('testin.csv') as infile: for line in infile: if some_condition(line): donotline=line else: f = open('testout.csv','a+') f.write(line)I have been trying to read from testin and write to testout.csv with the above code. The code runs but take approimatley 5 mins to read through 160000 lines. Is there any means to speed it up.
thanks
nuncio