En Sun, 25 Mar 2007 19:36:26 -0300, ianaré <[EMAIL PROTECTED]> escribió:

> list = ["Replace", "ChangeCase", "Move"]
> textVariable = list[n]
> self.operations.insert(pos, operations.[textVariable].Panel(self,
> main))
>
> Is something sort of like that possible?

Try getattr:
textVariable = "Replace"
getattr(operations, textVariable) == operations.Replace

Perhaps you could just store the result in your list; instead of  
["Replace", "ChangeCase", "Move"], use [operations.Replace,  
operations.ChangeCase, operations.Move] (it's not always applicable, of  
course: maybe operations is reassigned, or those attributes mutate or  
don't always exist...)

-- 
Gabriel Genellina

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

Reply via email to