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
> 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
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 (
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
>
> 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
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