Re: How to create Object and Data Properties dynamically ?

Posted by embisme on
URL: http://owlready.306.s1.nabble.com/How-to-create-Object-and-Data-Properties-dynamically-tp244p2022.html

We can do that dynamically bu the python way - setattr()

So we would have an individual say i of a class say c
Lets say the data property is d

So the general way is
 i.d = ['str']

But by using the setattr() we can write it dynamically as-
setattr(i, d, ['str'])

Hope this solves your problem!

Millennium