On Mon, Feb 16, 2009 at 4:01 PM, Wayne Watson
<sierra_mtnv...@sbcglobal.net> wrote:

> I see Marc covered it with setattr. How does one do it with a dictionary?

Instead of trying to create variables with variable names, use the
names as keys in a dict. So instead of
  exec "self.abc=22"
you might use
  self.values = {}
  self.values['abc'] = 22

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to