how to insert random error in a programming
steve+comp.lang.python at pearwood.info
Tue Oct 16 05:46:48 CEST 2012
On Mon, 15 Oct 2012 18:21:55 -0700, alex23 wrote:
> On Oct 16, 5:52 am, Chris Angelico <ros... at 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:
So I expect that in Python 3.4 this will work:
"a piece of string".transform('rot13')
codecs.encode('a piece of string', 'rot13')
but who knows really?
More information about the Python-list