module variable scope

Stefan Quandt squan at web.de
Wed Oct 29 03:42:10 EST 2003


"Batista, Facundo" <FBatista at uniFON.com.ar> wrote in message news:<mailman.170.1067348898.702.python-list at python.org>...
> > I expected variable v to be changed by calling setv() but it is not.
> > Who can explain this?
> 
> No, because you're creating a new 'v' variable in the *local* scope of
> 'setv'.
So how can I access the global module variable v within function
setv() (like getv() does automatically)?

Thanks again
  Stefan




More information about the Python-list mailing list