Index

Subject : LUG: Modifying global variables in Python

From : "Daniel Underwood" <daniel.underwood@ncsu.[redacted]>

Date : Wed, 28 Jul 2010 23:16:57 -0400


>From what I've read in forums, it seems that Python 2.6 does not have a
straight-forward way to modify global variables inside a function. This
example will put it more clearly:
<http://codepad.org/w7Aw2SpD>

The best "fix" I've found, is to do something like this:
<http://codepad.org/U1Ct7AFO>

Is there a simpler way to overcome this limitation?
--
Daniel Underwood
North Carolina State University
PhD Student - Industrial Engineering
email: daniel.underwood@ncsu.[redacted]
phone: XXX.302.3291
fax: XXX.515.5281
web: http://www4.ncsu.edu/~djunderw/



Replies :