Access to variable from external imported module

GinTon jonas.esp at googlemail.com
Thu Nov 23 18:36:56 EST 2006


Thanks Robert, the best solution is get all local variables, else is
impossible access to them.

robert ha escrito:
> GinTon wrote:
> > I would to access to values that are created locally in that method
>
> after the method has executed? usually the return value?
> or you want to get all local variables, then make a func/method
>
> def f(a=1):
>     b=2
>     c=3
>     return locals()  #X/Object(locals())
> 
> --------
> 
> d=module.f()
> print d['c']         # d.c




More information about the Python-list mailing list