Long int to int
Tim Howarth
tim at worthy.demon.co.uk
Mon Feb 11 06:46:09 EST 2002
In message <7xeljsp90d.fsf at ruckus.brouhaha.com>
Paul Rubin <phr-n2002a at nightsong.com> wrote:
> Tim Howarth <tim at worthy.demon.co.uk> writes:
> > (Or worse, I can convert with eval
> >
> > a = str(hex(a))[2:-1]
> > a = eval('0x'+a)
>
> a = eval('0x%x' % a)
>
> might be a little more palatable.
Nicer but I'm not sure that it works, I want
0xFFFFFFFFL
to become
-1
besides I grew up believeing eval==evil.
--
___
|im ---- ARM Powered ----
More information about the Python-list
mailing list