Solved Move objects in the hierarchy


With a script, I create a large number of objects in my scene.
In the hierarchy, they are presented in the form of a list, which becomes difficult to read because it's too long.
So I want to put the names of the child objects under the name of the root object.
How can I do this ?

def hierarchie_organise(doc, object_root, list_object):
	# document name: doc
	# object root: object_root
	# child objects: list_object 

	# checking (exclusion of the root object if it's in the list of child objects)
	list_child = []
	for object in list_object:
		if object != object_root:

	# positioning of list_child objects under the object_root object



I found the solution on
It was enough in the for loop to add the following line of code:

for object in list_object:
if object != object_root: