[Bf-python] global name is not defined?

Toni Alatalo antont at kyperjokki.fi
Fri Oct 19 10:34:27 CEST 2007


On 19.10.2007, at 11:06, naruto canada wrote:

> what is the difference between blender python and regular python?

there is no difference in the python itself, just the fact that it is 
embedded and can import Blender.

> def square(x): return (x * x)
> def sum_of_squares(x, y): return (square(x) + square(y))
> print sum_of_squares(3, 4)
> ...
> NameError: global name 'square' is not defined

that is quite strange, i don't get how that could happen. and actually 
it does not happen for me, but works both out and inside of Blender.

perhaps there is a typo in the version you have in Blender?

~Toni



More information about the Bf-python mailing list