A
Andy Dingley
I have some XML, with a variable and somewhat unknown structure. I'd
like to encapsulate this in a Python class and expose the text of the
elements within as properties.
How can I dynamically generate properties (or methods) and add them to
my class? I can easily produce a dictionary of the required element
names and their text values, but how do I create new properties at run
time?
Thanks,
like to encapsulate this in a Python class and expose the text of the
elements within as properties.
How can I dynamically generate properties (or methods) and add them to
my class? I can easily produce a dictionary of the required element
names and their text values, but how do I create new properties at run
time?
Thanks,