Newline at EOF Removal

Dylan Wilson dwilson.soap at gmail.com
Sun Jan 8 21:44:49 EST 2006


Do you mean somthing like this?

>>> f = open("file.txt")
>>> w = open('outfile.txt', 'w')
>>> for line in f.split('\n'):
...        w.write(line)
...
>>> w.close()
>>> '\n' in open('/home/wandleg/outfile.txt').read()
False




More information about the Python-list mailing list