I want to get the instance of an class object. I have its address and the name of the object. How can it be possible to create the instance of the object or how can I retrieve the same object?
The class is defined in one python module and i want it to be used in another python module.
Can I use object id to access the object of the class.?
My actual problem is that I have a Python module in which a class had been defined (class Myclass
). I am reusing the module in my new code. I want the object of Myclass
, which is defined in the old module, to be accessed in my new file.
Can anyone suggest me a way to achieve this? I don't have right to access the module source code where the class has been defined. I can manage to get the class name with the garbage collector.