/ Published in: Python
![](/img/icon_sav.png?v3)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
""" params is a string of the class that you want example: my_class = "do_something" instance = factory(my_class) the name module is hard coded ... """ def factory(cls_string, *args): cls = getattr(module, cls_string) return apply(cls, args)
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)