I need to pass a value created within a class method to a function, or procedure or def or whatever it is called, in the 'main program'
global myValue
class CalcFrame(object):
def clearFunc(self):
myValue = 12
def getUrl():
print myValue
This was my idea, obviously it does not work:
I do that code, then I create an object
x = CalcFrame()
call the method which should set the global
x.clearFunc()
then call the function which should print it
getUrl()
get the error
NameError: global name 'myValue' is not defined