I\'m a Python newbie.
How come this doesn\'t work in Python 3.1?
from string import maketrans # Required to call maketrans function. intab = \"aei
If you absolutely insist on working with 8-bit bytes:
>>> intab = b"aeiou" >>> outtab = b"12345" >>> trantab = bytes.maketrans(intab, outtab) >>> strg = b"this is string example....wow!!!"; >>> print(strg.translate(trantab)); b'th3s 3s str3ng 2x1mpl2....w4w!!!' >>>