Karl Pfl�sterer wrote on Sun, 13 Feb 2005 12:15:03 +0100:
> what's the Python way of accessing local variables in nesting functions? For
> then there's no problem in running such function, but what if I'd like to
> modify var1 so that the change were vissible in p()?
I'd use return in the form of
def p():
v = 3
def q():
return v+1
v = q()
If you need to modify a lot of p-vars inside q, I'd say it's probably wiser
to go with a class and appropriate methods.
--
Yours,
Andrei
=====
Real contact info (decode with rot13):
[EMAIL PROTECTED] Fcnz-serr! Cyrnfr qb abg hfr va choyvp cbfgf. V ernq
gur yvfg, fb gurer'f ab arrq gb PP.
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor