On Thu, May 28, 2009 at 6:47 AM, John [H2O] <[email protected]> wrote:

> # Now I want to put them into my stuff class:
>    for j in range(len(a)):
>        cmd = "h.%s = a[%s][0]" % (I[j],j)
>        eval(cmd)

Use setattr() rather than eval. Something like
  setattr(h, l[j], a[j][0])

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

Reply via email to