Hi again - thanks for your help with my question early today (and last
night).  Tried searching google for this next question but can't get
an answer ... here is what I would like to do (but it is not working)
...

>>>dict = {'test1': 'value1', 'test2': 'value2', 'test3': 'value3'}
>>> class Test():
...   def __init__(self):
...     for key in dict:
...       self.key = dict[key]
...
>>> t = Test()
>>> t.test1
Traceback (most recent call last):
  File "<console>", line 1, in <module>
AttributeError: Test instance has no attribute 'test1'
>>> t.key
'value3'

Can I do what I am dreaming of ?



Thanks,
Damon
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to