I'm creating a little stock management app and I want to access a variable from ClassA in ClassB
ClassA(Screen):
def test1(self):
self.username = "Tonny"
ClassB(Screen):
def test2(self):
print(ClassA.test1.username)
This code dont work, i already tried like this:
ClassA(Screen):
def test1(self):
self.username = "Tonny"
return self.username
ClassB(ClassA,Screen):
ClassA = ClassA()
def test2(self):
print(ClassA.test1())
The second piece of code should work, but I can't use it because of the screen manager, it stop working right when I put another argument in the class.
Does anyone know how can I do this?