[Tutor] My first counter... is broken.
Magnus Lycka
magnus@thinkware.se
Thu, 08 Aug 2002 16:42:57 +0200
At 11:36 2002-08-08 +0000, Kyle Babich wrote:
>I thought I would try to make my first counter. Once I wrote it and
>worked a bug out my counter started working... well, sort of.
>It counted 1, 2, and then it jumped to something in the hundreds, then
>thousands, and then the page just went white.
>This is what showed in my error log:
>
>Traceback (most recent call last):
> File "/home/sites/kmb/www/public_html/njindenial/counter.py", line 8,
> in ?
> number =3D int(number)
>ValueError: int() literal too large: 01213121412131215
Can't you guess? Perhaps you could have a look in the file
after each access, and you might figure it out. (I don't really
want to take this debugging experience away from you. You will
probably get this Aha! experience after a while.) Make sure there
are no parallel executions of the script while you debug it.
Hint: What does FILEOBJECT.write() really do? What would
happen if you called it several times? What is FILEOBJECT.seek()
for?
--=20
Magnus Lyck=E5, Thinkware AB
=C4lvans v=E4g 99, SE-907 50 UME=C5
tel: 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se