On Tue, Jun 24, 2008 at 3:11 PM, cirfu <[EMAIL PROTECTED]> wrote: > from string import maketrans > > ok but how can i write: > pattern = maketrans('A-XY-Za-xy-z', 'C-ZA-Bc-za-b') > pattern = maketrans('A-Za-z', 'C-Bc-b') > none works....
maketrans doesn't work like that, you would need something like this: sfrom = string.uppercase + string.lowercase sto = string.uppercase[2:] + string.uppercase[:2] + string.lowercase[2:] + string.lowercase[:2] table = string.maketrans(sfrom, sto) print string.translate(phrase, table) > -- > http://mail.python.org/mailman/listinfo/python-list > -- -- Guilherme H. Polo Goncalves -- http://mail.python.org/mailman/listinfo/python-list