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?

6 of 26 people (23%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

How can I convert a hex number to a string?

Jul 6th, 2000 03:35
unknown unknown, Remco Gerlich


x = 0x26100     
y = "0x%x" % x  # String formatting "%x" formatter makes hex numbers
y is now "0x26100".