On 28/10/2014 at 10:57, xxxxxxxx wrote:
Hi
I'm trying to get global variables working - I have a strange problem where if make a comparison test - I can no longer change the value afterwards without crashing.
for example...
> import c4d
>
> from c4d import gui
>
> #Welcome to the world of Python
>
>
>
>
> def main() :
>
> if x != y:
>
> y = 0
>
> print y
>
>
>
>
> if __name__=='__main__':
>
> x = 3
>
> y = 7
>
> main()
>
>
>
gives the error,
UnboundLocalError: local variable 'y' referenced before assignment