Kent Johnson wrote on 20.11.2005:

>Use getattr() to access attributes by name. SiteA is an attribute of Templates 
>and Page is an attribute of SiteA so you can get use getattr() twice to get 
>what 
>you want:
>
>site = getattr(Templates, self.site_name)
>self.template = getattr(site, self.template_type)
>

Thank you! I did not take into account that modules and classes can be treated 
just like data attributes.

- Jan
-- 
Remember: use logout to logout.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to