Seeing "locals()" from imported function
Luis M. González
luismgz at gmail.com
Sun Feb 24 06:06:08 CET 2008
I apologize for this very basic question, but I can't understand how
I want to import a function from module B into my main script A, so
this function can see and use the locals from A.
urls = ['/', 'index']
for k,v in __main__.locals().items(): # these "locals"
are the ones of the main script
if isinstance(v,type) and k != 'index':
Of course this doesn't work...
More information about the Python-list