[Tutor] function error

roberto roberto03 at gmail.com
Wed Sep 29 20:54:20 CEST 2010


On Tue, Sep 28, 2010 at 8:26 PM, Evert Rol <evert.rol at gmail.com> wrote:
>
> Perhaps if you provide the full traceback from the error (assuming you're still getting this >error); tracebacks generally show the offending code as well. It may be something that's >simply overlooked but shows in the traceback.
>
>

here it is:

TypeError                                 Traceback (most recent call last)

~/randomMove2.py in <module>()
----> 1
      2
      3
      4
      5

~/randomMove2.py in randomMove2(d1, d2, a1, a2)
      6          while 1:
      7                  turtle.left(random.uniform(a1,a2))
----> 8                  checkForward.checkForward(random.uniform(d1,d2))
      9                  if forward_failed == 'true':
     10                          turtle.right(180)

~/checkForward.py in checkForward(distance)
      8
      9         turtle.forward(distance)
---> 10         forward_failed = outOfBounds()
     11         turtle.setx(old_position[0]); turtle.sety(old_position[1])
     12         turtle._pen.down()

~/checkForward.py in out_of_bounds()
     19
     20 def outOfBounds():
---> 21         if (abs(turtle.position()[0]) >
turtle.window_height()/2) or (abs(turtle.position()[1]) >
turtle.window_width()/2):
     22                 return "true"
     23         else:

TypeError: 'function' object is unsubscriptable


thank you
--
roberto


More information about the Tutor mailing list