[mod_python] global data in psp_/python.

Ole Jacob Hagen waterthrill at yahoo.no
Wed Aug 11 14:31:37 EDT 2004


Hi.

I am having a intricate problem....
I am using psp, and my configuration is right...

I am using two frames, an upper frame and one lower frame.
I will describe a simple example:

-----------------------------------------------------------------------------
quasi-code:

upper_frame:
1. form, input="textfield" name=data, should be a number.
2. input="submit"


lower_frame:
1. initialize NUMBER=0 if NUMBER is not initialised
2. req.write("%s = %s + %s" %(NUMBER+upper_frame.data, NUMBER, 
upper_frame.data))
3. set NUMBER = NUMBER+upper_frame.data to be used next time

example of usage:
1. number in textfield in  upper_frame = 10, and click submit
2. lower_frame will receive and add NUMBER and upper_frame.data (which 
is received from POST). The number 10 is the answer.
3. New value of NUMBER is stored.
4. number in textfield in  upper_frame = 15, and click submit
5. lower_frame will receive and add NUMBER and upper_frame.data (which 
is received from POST).
6. NUMBER = 10 fram the last addition, and NUMBER+upper_frame.data = 25
7. set NUMBER = NUMBER+upper_frame.data to be used next time.

----------------------------------------------------------------

My question is how can I implement the lower_frame?
I mean; How can I handle the NUMBER-variable?
Is it possible, at all?


Cheers,

Ole J.





More information about the Mod_python mailing list