January 16th, 2002, 09:49 AM
how do I scoop variables??
I'm currently using python to write a cgi script, I was wondering how I go about using a variable defined in one function outside of that function, without having to define it as a global variable.
I've heared something about 'variable scooping' as being a way around this, can anyone give me a bit of info about how to do this?
January 18th, 2002, 05:37 AM
variable scope is just the 'scope' in which the variables work. For example, a variable defined in a function won't work in the global namespace. If you want to use it in another function, I think the best is to just pass that variable to the other function.
Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. - Jamie Zawinski, in comp.lang.emacs