:spin: Hi! I’m working on a project where i need to update the values in a vector, but i need to save this vector directly under the owner. I initialize de vector in a python file and i update it in another one, but it says “object does not support item assignment”. The initialization is owner.test=[0,0,0,0] and the updating goes like this owner.test[i]=newvalue. where i is a number between 0 and 3.
Thanks in advance!! :spin:
It seems you can’t assign lists directly to properties. You can do following:
x = [0,0,0,0]
x[1] = 2
#notice the spaces between the items when printed
print "x = ", x
own.test = x
#notice there are no spaces between the items when printed
print "test =", own.test
later:
y = eval(str(own.test))
print "y =", y
y[3] = 63
use x and y to process your vector. Own.test can be the container of the data.
I hope this helps.