mennosimons at gmx.net
Tue Sep 24 15:01:44 EDT 2002
jubafre at brturbo.com wrote:
> <type 'str'>
> the hex() function put the hexadecimal number in a string type like this
> '0xa', but the real hexadecimal number of 10 is 'a', why python puts a
> '0x', and how i can get just the real hexadedcimal number, for example i
> want to write in a file 10 in hexadecimal, but if i use hex(10) the result
> is '0xa' as a string, is not the same as 'a'.
> '0xa' != 'a'
> x = [12,13,14]
> y = ['0xc', '0xd', '0xe']
> hex() create a list of string, how i can write in a file just the real
> value of hexadecimal number?
> Juliano Freitas
With your nice Python strings:
>>> "%x, %x, %x, %x"%(1,10,14,24234234)
'1, a, e, 171c8fa'
More information about the Python-list