I'm trying to figure out how to remove an empty line from a text file while only using python. The input should be like:
firstline
secondline
thirdline
And the output should be:
firstline
secondline
thirdline
So I have this right now...
import sys
with open("New Text Document.txt") as f:
for line in f:
if not line.isspace():
sys.stdout.write(line)