I'm trying to figure out some problem I have. I have written small program just for the example here (which i'll implement the solution in the real one :) )
So, I have 3 files One -Which is the main Test -Which is the test I run CounterTest -Which has class with def inside
One:
def main():
CounterTest=1
execfile("c:\\111\\Test.py")
if __name__ == '__main__':
main()
Test:
from CounterTest import *
print "THIS IS THE TEST"
CallClass=CounterTest1()
CallClass.CounterPlus()
CounterTest:
class CounterTest1():
def CounterPlus(self):
CounterTest +=1
print CounterTest
Scenario: I run "one" which execute file Test (All this happen in main def) In "Test" I'm calling class and def -in def we counter +1 , that was defined in "one" file.
I'm getting "local variable 'CounterTest' referenced before assignment"
I have tried everything but nothing worked
Appriciated ,
Thanks