dmytro_ushatenko/pages/students/2016/darius_lindvai/dp2021/script1.py

12 lines
309 B
Python
Raw Normal View History

2020-04-10 07:34:14 +00:00
# coding: utf-8
#!/usr/bin/python
import codecs
import sys
with codecs.open(sys.argv[2],'w') as out_txt:
with codecs.open(sys.argv[1],'r') as text:
for line in text:
line = line.replace('.','PER').replace(',','COM').replace('?','QUE')
out_txt.write(line)