I started experimenting with web.py and I like how thin and efficient
it is.  However, me being a relative newbie to web programming, I had
a question:

I have a 4MB file that I need to read and parse into a list.  I only
need to do this once, not every time the page loads.

My file roughly looks like this:

#!/usr/bin/env python

urls = (
   "/handler", "handler",
)

f = open('enable2.txt')
wordList = [line.strip() for line in f]

class handler:
   def GET(self):
      #process wordList based on input
      return returnWordList

app = web.application(urls, locals())

if __name__ == "__main__":
   app.run()


Does this load the wordList once, or does it do it on every
invocation?  If it does it on every invocation, is there some way to
statically load it once, and keep it persistently in memory?

Thanks in advance,

Ken

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to