|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > how do I scoop variables?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|