On Mon, 15 Oct 2012 18:21:55 -0700, alex23 wrote:

> On Oct 16, 5:52 am, Chris Angelico <ros...@gmail.com> wrote:
>> Surely there's a shorter way to rot13 a piece of text? CODE GOLF!
> 
> In Python2: "a piece of string".encode('rot13') :)

And in Python 3, unfortunately there has been a right-royal mess made of 
the codecs system:

http://bugs.python.org/issue7475

So I expect that in Python 3.4 this will work:

"a piece of string".transform('rot13')

or this:

import codecs
codecs.encode('a piece of string', 'rot13')


but who knows really?



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to