how to get character hex number?

contro opinion contropinion at gmail.com
Fri Aug 31 22:21:51 EDT 2012


>>> for i in "english" :
...   print(hex((ord(i))))
...
0x65
0x6e
0x67
0x6c
0x69
0x73
0x68
>>> u"english".encode("utf-8")
'english'
>>> u"english".encode("ascii")
'english'

how can i get 656e676c697368 in encode method?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120831/cfd352cc/attachment.html>


More information about the Python-list mailing list