Dynamically add Class to Modules

Mike Meyer mwm at mired.org
Thu Dec 8 18:12:24 EST 2005


callmebill at gmail.com writes:
> So:  Does anyone know how dynamically generate a class, and add it to a
> "module" that is already in memory?

How about adding a step:

generate your class to a file
import the file as a module.
bind a name in "module" to the class in the imported module.

     <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list