I once had to decode hex strings that were in ASCII to the proper hex values.
I found this on the web:
map( ord, codecs.decode( '030109ff', 'hex' ) )
The more pythonic way would then be:
[ ord(x) for x in codecs.decode( '030109ff', 'hex' ) ]
Cool.
Sunday, March 22, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment