Overflow error when printing long values

Paul Rubin phr-n2001 at nightsong.com
Thu Aug 30 11:51:25 EDT 2001


michaelteo at bigfoot.com (Michael Teo) writes:
> I get an "OverflowError: long int too long to convert" when I tried to 
> print "%d" % l
> where l is a long Python value.
> 
> I have tried using str(l) but that gives a trailing 'L'.
> 
> Any good suggestion on how to solve this problem will be greatly
> appreciated. Thanks.

print str(l)[:-1]



More information about the Python-list mailing list