with open("test.txt") as f:
lines = f.readlines()
lines = [l for l in lines if "Python" in l]
with open("out.txt", "w") as f1:
f1.writelines(lines)
lines = f.readlines()
lines = [l for l in lines if "Python" in l]
with open("out.txt", "w") as f1:
f1.writelines(lines)
No comments:
Post a Comment