7 Feb
2005
7 Feb
'05
9:15 p.m.
I would like to decode/encode data in base64 without resorting to an external Python method.
The following is in the Python interpreter, but I have verified that it works for Python scripts in Zope.
"Hello World!".encode('base64') 'SGVsbG8gV29ybGQh\n' 'SGVsbG8gV29ybGQh\n'.decode('base64') 'Hello World!' 'Clguba ebpxf!'.decode('rot13') u'Python rocks!'
I tried your suggestion, but it does not work in Zope. I createad a simple Script(Python) object like this: print 'ciao ciao'.encode('base64') return printed But when I try to see it from Zope it returns this error: Error Type: SystemError Error Value: module "encodings.base64" failed to register Bye