Problem with variables assigned to variables???

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Wed Apr 30 06:37:24 EDT 2008


n00m a écrit :
> for listmember in mylist:
>     print listmember + ".shp", eval(listmember)

eval and exec are almost always the wrong solution. The right solution 
very often implies a dict or attribute lookup, either on custom dict or 
on one of the available namespaces (globals(), locals(), or a module, 
class or instance).




More information about the Python-list mailing list