|
From: Ron A. <rr...@ro...> - 2008-01-13 07:12:56
|
Bruce Sherwood wrote:
> There's something wrong with the program you posted:
>
> Traceback (most recent call last):
> File "C:\Documents and Settings\Bruce\My Documents\Python
> stuff\vspace.py", line 279, in -toplevel-
> ship.animate(period, len(asteroids))
> File "C:\Documents and Settings\Bruce\My Documents\Python
> stuff\vspace.py", line 121, in animate
> self.status.text = 'frame rate = %i, asteroids = %s' \
> ZeroDivisionError: float divmod()
If I change the time.time() calls to time.clock(), I get that too.
I did have the import wrong for the time module. Since I originally wrote
this on XP.
Changed:
from time import clock
to:
import time
# use time.clock if it works, else use time.time.
if time.clock() != time.clock():
time.time = time.clock
There is differences between time.clock and time.time between linux and
windows. I'm using Ubuntu. The above should fix it.
File attached with corrections.
> Also, I'll note that you have the following:
>
> scene.range = (0, 0, 0)
> scene.scale = (.1, .1, .1)
Thanks, removed the scene.range assignment.
Ron
|