Function to import module to namespace
bob at mellowood.ca
Sun Jun 29 21:08:36 CEST 2008
Is it possible to do this from a function: import a module and append
the defs in that module to an existing module/namesapce.
So, in my code I have something like:
# main code
# end of main
this will permit the addition of the the stuff in file 'n.py' to 'mods'.
Assuming that foo1() is defined in newmod, I should now be able to do
something like mods.foo1().
More information about the Python-list