while 1:
	        for obj in tracking.objects():

In the above snippet of code tracking.objects() returns a list of objects with above mentioned properties.
tracking.update() continuously updates obj attributes and adds new objects.

Our requirement was to have an Multi dimensional list in which objects with its values should be stored as individual list.

But the out put got is , where each xpos, ypos, xmot etc are created as individual lists for different objects.
How can this be reversed.

tracking.objects() returns a list of objects

If it does return a list then you would use
or allobjs.append(tacking.objects[0])
etc. We here have no way of knowing what obj[0] contains. A little more info is necessary as you seem to be using a list of classes but that is just a guess.

Ok. I understand what you are trying to tell me. But the problem is the list is dynamically updated . I don't have the number of objects that are there in the list. The list is dynamically updated once tracking.update is called. And yes the objects are classes and it is a list of classes .

allobjs.append(obj[0]).. can this format be used ? Given that obj is just a local variable used for indexing in the for loop. Well i did try a format similar to what you have put up . Since the list of objects returned will be NULL initially before any object is tracked , using indexing gives me the IndexError.

This article has been dead for over six months. Start a new discussion instead.