lower_rm.py 300 Bytes
Newer Older
xuchen committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
import sys
import string


in_file = sys.argv[1]

with open(in_file, "r", encoding="utf-8") as f:
    for line in f.readlines():
        line = line.strip().lower()
        for w in string.punctuation:
            line = line.replace(w, "")
        line = line.replace("  ", "")
        print(line)