dynamic variable referencing
mwilliams at mgreg.com
Wed Dec 7 02:13:57 CET 2005
I would RTM, but I'm not sure exactly what to look for. Basically, I
need to be able to call a variable dynamically. Meaning something
like the following:
- I don't want to say OBJECT.VAR but rather OBJECT.
("string") and have it retrieve the variable (not the value of
it) if in fact it exists. . .
The purpose is to create an XML tree myself by means of OBJECT.
("string").__setattr(name,value). I eventually want to be able to
say BOOK.AUTHOR.FIRSTNAME . . . that kind of thing. I've seen
existing libraries, but I'd really rather know how to do it myself.
Any assistance would be appreciated.
More information about the Python-list