Hi,

If the «variables» are named attributes you can use getattr.


#----------------
class colors:
        red=1
        green=2
        blue=3
        
c=colors()

a=['red','green','blue']

for v in a:
        print v,getattr(c,v)
#-----------

AB
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to