chr / ord

Sean McIlroy sean_mcilroy at yahoo.com
Tue Nov 3 14:40:21 EST 2009


thanks. that did the trick. in case anyone else is in the same boat as
myself, here are the relevant correspondences:

string <-> [int]                                 bytes <-> [int]
---------------
--------------

lambda string: [ord(x) for x in string]           list
lambda ints: ''.join([chr(x) for x in ints])      bytes




More information about the Python-list mailing list