On Mon, Feb 16, 2009 at 10:01 PM, Wayne Watson <sierra_mtnv...@sbcglobal.net> wrote: > My limited repertoire. Actually, there wasn't much of a traceback. It came > up in a small OK dialog. I copied what I could. I see my image I used above > did make it to the list, so here's the skinny. > > > I see Marc covered it with setattr. How does one do it with a dictionary? > What else lurks out there that might be useful along these lines?
It all depends on what you will use it for. As said, exec should work, but it usually is not the way to go - if there's outside input involved, it's _extremely_ unsafe, if everything comes from inside your program it's an ugly sledgehammer to crack a nut. So please take one step back - WHY do you want to do this? Where does this string "self.abc = 22" come from? What are the values it can have? Can you create a toy example that shows the problem you want to solve? -- André Engels, andreeng...@gmail.com _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor