[EMAIL PROTECTED] schrieb:
> okay, I try you suggestion, and re-write my code like this:
> colors = ["#ff0000", "#00FF00", "#0000FF"]
> colorIndex = 0
> 
> def getText(nodelist):
> 
> 
>              for str in strings:
> 
>                      print colors[colorIndex  % colors.length]
>                      colorIndex += 1
> 
> but i get this error:
>    print colors[colorIndex  % colors.length]
> UnboundLocalError: local variable 'colorIndex' referenced before
> assignment

If I take your code, it works for me.

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to