Is there a way to access/modify/add variables to caller from a sub function

Ulrich Petri ulope at gmx.de
Tue Jul 22 15:41:57 EDT 2003


"Anand" <anand_soliton at yahoo.com> schrieb im Newsbeitrag
news:3f5dc178.0307220913.62a7e92f at posting.google.com...
> Is there a way to access/modify variables of a caller function from
> within a sub function call?
>
> Function A:   Calls subFuncB:
>
> var x           Add var xx in Function A's name space??
> var y
> var z


def funcB(foo):
    return foo*1, foo*2, foo*3

def funcA():
    f1,f2,f3 = funcB(1)


Ciao Ulrich






More information about the Python-list mailing list