On Oct 12, 11:07 pm, "Alex Holkner" <[EMAIL PROTECTED]> wrote:
> On 10/13/08, LaundroMat <[EMAIL PROTECTED]> wrote:> def update(dt):
> ...
> > x = left.next()
> > except StopIteration:
> > left = bkg_scroll()
>
> ...
>
> The `left = ...` line forces Python to compile update with `left` as a
> local variable. When it tries to evaluate `left.next` it looks for
> the local variable `left`, and doesn't find it (because it hasn't been
> assigned yet).
>
> You probably want to add `global left` to the top of the update
> function, to tell Python that you want to assign to the global
> variable, and not create a new local.
>
> Alex.
Thanks! I wonder why I haven't met this problem before..
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---