← Back to team overview

yade-users team mailing list archive

Re: [Question #685223]: what are the input variables to get the micro-stress firled

 

Question #685223 on Yade changed:
https://answers.launchpad.net/yade/+question/685223

    Status: Open => Answered

Bruno Chareyre proposed the following answer:
> besides, I don't know why the list index is out of range.

Hi,
I have a small training to suggest, try to recognize this pattern in your code:

listOfIds=range(len(O.bodies))
O.bodies.append(Body())
print(listOfIds[0])

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
/usr/bin/yadedaily in <module>()
----> 1 print(listOfIds[0])

IndexError: range object index out of range


Bruno

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.