Apr-18-2019, 09:15 PM
Can write it it like this.
So
match = 'VisaRen' with open('lines.txt') as f,open('new.txt', 'w') as f_out: for line in f: if match in line: f_out.write(line)
(Apr-18-2019, 09:05 PM)SnakeTyro Wrote: However, is there a simpler "Line Input, Write" routine until the end of file ("While Not EOF")?Python always read to EOF,if not stop it in anyway.
So
for line in f:
read one line(memory effective) at time to EOF.