Helpful Information
 
 
Category: Python Programming
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?

Thanks

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.










privacy (GDPR)