problem updating variable in a module

dudeja.rajat at dudeja.rajat at
Wed Sep 24 10:42:05 EDT 2008


I've a problem updating my variable in a module.

In my main program, I call a function from mod1 to update a variable of mod1
As soon as I update this varibale, I check it back in the mail program but
it the variable from mod1 does not get updated.

main Program:
import mod1
a = 20
print mod.a   <---- does not print anything

a = 10
def update(someInt):
     global a
     a = someInt
     print a     <---- this does actually print a = 20

Please help.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list