Suppose you have to create 10 class objects in python, and do something with them, like:
obj_1 = MyClass() other_object.add(obj_1) obj_2 = MyClass() other_ob
I hope this is what you are looking for.
class Try: def do_somthing(self): print 'Hello' if __name__ == '__main__': obj_list = [] for obj in range(10): obj = Try() obj_list.append(obj) obj_list[0].do_somthing()
Output:
Hello