python - How to create global variables? -


i need create variable (an array of floats) accessible , modifiable python controllers. if want know why need this, i'm trying implement neuroevolution , need store neural network parameters. i'm new python.

there dictionary (https://docs.python.org/2/tutorial/datastructures.html) accessible globally in blender.

it comes gamelogic-library , called globaldict

http://wiki.gameblender.org/index.php?title=globaldict

usage:

import gamelogic  ...  gamelogic.globaldict['key'] = value  ...  value = gamelogic.globaldict['key'] 

Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -