This would be a good case to use OO design, imo. The following works fine. Simply instantiate the object, call the method, and you can access (and manipulate) the "module's" variable to your heart's content.
module.py class object: def __init__(self): self.test = 1 def A(self): for x in range(10): self.B() def B(self): self.test = self.test + 1 main.py from module import object MyObj = object() print MyObj.test MyObj.A() print MyObj.test -- http://mail.python.org/mailman/listinfo/python-list