remove empty lines from file python
with open("new_file","r") as f:
for i in f.readlines():
if not i.strip():
continue
if i:
print i,
Are there any code examples left?
New code examples in category Python
with open("new_file","r") as f:
for i in f.readlines():
if not i.strip():
continue
if i:
print i,