Я хочу удалить все знаки препинания из текстового файла, используя метод .translate(). Кажется, он хорошо работает под Python 2.x, но под Python 3.4 он ничего не делает.
Мой код выглядит следующим образом, а вывод такой же, как и текст ввода.
import string
fhand = open("Hemingway.txt")
for fline in fhand:
fline = fline.rstrip()
print(fline.translate(string.punctuation))