Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old January 16th, 2002, 09:49 AM
nickname nickname is offline
inexperienced and useless
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: Stevenage, uk
Posts: 10 nickname User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old January 18th, 2002, 05:37 AM
Taradino Taradino is offline
Python Prophet
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Amersfoort, The Netherlands
Posts: 45 Taradino User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > how do I scoop variables??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway