Newline at EOF Removal

Dylan Wilson dwilson.soap at gmail.com
Mon Jan 9 03:44:49 CET 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