How to convert arbitrary objects directly to base64 without initial string conversion?

Russell Warren russandheather at gmail.com
Thu Jul 13 11:44:48 EDT 2006


> Many functions that operate on strings also accept buffer objects as parameters,
> this seems also be the case for the base64.encodestring function.  ctypes objects
> support the buffer interface.
>
> So, base64.b64encode(buffer(ctypes_instance)) should work efficiently.

Thanks!  I have never used (or even heard of) the buffer objects.  I'll
check it out.

Russ




More information about the Python-list mailing list