Instantiate an object based on a variable name

Martin P. Hellwig martin.hellwig at dcuktec.org
Thu Dec 31 12:04:11 EST 2009


Wells wrote:
> Sorry, this is totally basic, but my Google-fu is failing:
> 
> I have a variable foo. I want to instantiate a class based on its
> value- how can I do this?

My crystal ball is failing too, could you please elaborate on what 
exactly you want to do, some pseudo code with the intended result will 
be fine.

-- 
MPH
http://blog.dcuktec.com
'If consumed, best digested with added seasoning to own preference.'



More information about the Python-list mailing list