Re: [Tutor] Covert numbers to hex fails

2005-05-25 Thread Tom Tucker
Alan, Thanks! Your response was helpful. I was trying to pass a number variable to the hex object. The output associated with this would be referenced in the hexoutput variable. I guess this is as simple as hexoutput = "%X" % (value) Thanks again for the help, Tom On 5/25/05, Alan G <[E

Re: [Tutor] Covert numbers to hex fails

2005-05-25 Thread Alan G
> Good evening! I am trying to pass a number variable and have it > converted to hex. Any recommendations on how to achieve this? You appear to have answered your own question below. What exactly is the problem? FAILS -- >>> value = 1234567890 >>> hexoutput = hex('%d' % (value)) WOR

Re: [Tutor] Covert numbers to hex fails

2005-05-24 Thread ZIYAD A. M. AL-BATLY
On Tue, 2005-05-24 at 22:56 -0400, Tom Tucker wrote: > Good evening! I am trying to pass a number variable and have it > converted to hex. Any recommendations on how to achieve this? Thank > you. > > FAILS > -- > >>> value = 1234567890 > >>> hexoutput = hex('%d' % (value)) > Traceback (

Re: [Tutor] Covert numbers to hex fails

2005-05-24 Thread Tom Tucker
Thanks!I see the mistake. On 5/24/05, Tony Meyer <[EMAIL PROTECTED]> wrote: > > FAILS > > -- > > >>> value = 1234567890 > > >>> hexoutput = hex('%d' % (value)) > > Traceback (most recent call last): > > File "", line 1, in ? > > TypeError: hex() argument can't be converted to hex >

Re: [Tutor] Covert numbers to hex fails

2005-05-24 Thread Tony Meyer
> FAILS > -- > >>> value = 1234567890 > >>> hexoutput = hex('%d' % (value)) > Traceback (most recent call last): > File "", line 1, in ? > TypeError: hex() argument can't be converted to hex Just don't convert the number to a string, e.g: >>> value = 1234567890 >>> hexoutput = hex(value

[Tutor] Covert numbers to hex fails

2005-05-24 Thread Tom Tucker
Good evening! I am trying to pass a number variable and have it converted to hex. Any recommendations on how to achieve this? Thank you. FAILS -- >>> value = 1234567890 >>> hexoutput = hex('%d' % (value)) Traceback (most recent call last): File "", line 1, in ? TypeError: hex() argume