[Bf-python] global name is not defined?

naruto canada narutocanada at gmail.com
Fri Oct 19 11:17:17 CEST 2007


On 10/19/07, Toni Alatalo <antont at kyperjokki.fi> wrote:
> 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?

This is not possible, the script was run from
"/home/blender/.blender/scripts/console_autoexec.py"
which is file-- so no typo is possible.
I've also tried the console as well--
since copy and paste is not working, I manually typed the same script--
same error.
trust me, it's not typo.


>
> ~Toni
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>



More information about the Bf-python mailing list