Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!python3
- # coding: utf-8
- """Trim white space from end of line."""
- import sys
- if len(sys.argv) < 2:
- sys.exit("Usage: eol.py FILENAME[S]")
- for filename in sys.argv[1:]:
- try:
- with open(filename, "r") as finp:
- lines = finp.readlines()
- except Exception as err:
- print(err)
- else:
- with open(filename, "w") as fout:
- for line in lines:
- fout.write(line.rstrip()+"\n")
Add Comment
Please, Sign In to add comment