A module's name and its functions/clasess

Martin v. Loewis martin at v.loewis.de
Thu Oct 17 15:24:22 CEST 2002


Xiao-Qin Xia <xx758 at cam.ac.uk> writes:

> Can a module know itself's name and the functions/clasess defined in the 
> module? (in order to bind these functions/classed with psyco)

The name is available as __name__, the functions are available by
iterating through globals(). Make sure you skip classes, and other
data.

Regards,
Martin




More information about the Python-list mailing list