Trouble with psyco
F. Petitjean
littlejohn.75 at noos.fr
Mon Nov 22 08:17:15 EST 2004
On Mon, 22 Nov 2004 02:07:46 -0800, Dick Moores <rdm at rcblue.com> wrote:
> psyco is acting a bit psycho for me.
>
> Please see my spinForWeb.py at <http://www.rcblue.com/Python/spinForWeb.py>
>
> When psyco is in use, entering an integer somewhere between 2000 and 2500
> causes my computer to freeze. Not really freeze but the program doesn't
> finish, and I have to quit with a ^Q.
>
> psyco is really impressive, but I'm disappointed that I can't demonstrate
> (to friends) counting with it to numbers above 2 billion.
>
> If I remark out the "psyco.bind(spin)" line, there's no problem no matter
> what integer I enter. Can someone explain what the problem with psyco is?
It seems like a problem with your python code. If you enter 2200 :
max = raw_input("positive integer: ") # "2200"
millions = int(max) # to use for printing result # 2200
max = int(max) * 1000000 # not possible on a 32bits platform
# as it is greater than sys.maxint
So please write : max = int(max) * 1000000L
and choose another name (vmax for instance) which doesn't hide a
builtin. And likewise initialize k as k = 0L
>
>
> Thanks,
>
> Dick Moores
> rdm at rcblue.com
>
>
>
More information about the Python-list
mailing list