Ognjen Bezanov enlightened us with:
> Hi all, I am trying to convert a hexdecimal value to a char using this code:
>
> print ' %c ' % int(0x62)
This is an integer ^^^^
> this works fine, but if I want to do this:
>
> number = "62"
> print ' %c ' % int("0x" + number)
This is a string ^^^^^^^^^^^^^
> How can I convert a string "0x62" to int/hex without this problem?
In [0]: exec('num=0x%s' % '62')
In [1]: num
Out[1]: 98
Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself?
Frank Zappa
--
http://mail.python.org/mailman/listinfo/python-list