xama...@yahoo.com wrote:

> If I have an integer k, for instance;
> 
> k = 32 // BASE 10
> 
> How do I get print to print it out in HEX and PREFIXED with 0x? What
> is the PROPER WAY?
> 
> This does not work:
> 
>   print "This is hex 32: ", int(k, 16)
> 
> Xav

How about this :

k=32
print "This is hex 32: 0x%02X" % k

Kind Regards,
BgEddy

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to