fn = "/Users/david/Documents/videos_files.txt" nfn = "/Users/david/Documents/new_videos_files.txt" import os import codecs import unicodedata nfp = codecs.open(nfn, "w", encoding="utf_8") with codecs.open(fn, 'r', encoding="utf_8") as fp: # fnd = fp.read() # print(fnd) for ln in fp.readlines(): # 자모가 흩어진 걸 모으려면 아래와 같이 NFKC로 정규화 해야 함. nln = unicodedata.normalize("NFKC", ln) print(ln) nfp.write(nln+"\n")
댓글 없음:
댓글 쓰기