Hi,
I try to use global variable in a controller.

global a
a=5

def index():
    return dict()

def func1():
    global a
    a=request.vars.id1

def func2():
    global a
    print a

The html page call func1 first and change the value of the global
variable "a" to 8. But when html page call func2 afterwards, the value
of the global variable "a" printed out is still 5.

Can anyone tell me why this happens and how to make variable in a
controller global?

Thanks alot.

Reply via email to