On Fri, Apr 12, 2013 at 1:30 AM, Lamb <[email protected]> wrote:
> import string
> s = "string. With. Punctuation?"
> out = s.translate(string.maketrans("",""), string.punctuation)
Try this instead:
import string
s = "string. With. Punctuation?"
out = s.translate(str.maketrans("", "", string.punctuation))
Due to the changes in string handling (s is a Unicode string in Python
3, not a string of bytes), str.translate() got changed. Check out
help(str.maketrans) and help(str.translate) in interactive Python for
more details.
ChrisA
--
http://mail.python.org/mailman/listinfo/python-list