faqts : Computers : Programming : Languages : Python : Common Problems : Strings

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

53 of 99 people (54%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

How do I convert a string to hex?

Jul 6th, 2000 03:31
unknown unknown, richard_chamberlain


import string
b = "6b584"
i=string.atoi(b,16)
print hex(i)
0x6b584