Let's say i have two classes in such a way:
class Class1(ParentClass1):
def __init__(self):
super(Class1, self).__init__()
c2 = Class2()
def foo(self):
pass
class Class2(ParentClass2):
def __init__(self):
super(Class2, self).__init__()
def bar(self):
foo() # from Class1
how to access foo() from Class2 if instance of Class2 is created in Class1, while Class1 itself is initiated in another class?
In other words, the dialog box(Class2) must update the list from Class1.
UPDATE
Initially, I had an instance of Class0 in __name__ == '__main__'. Class0 creates the instance of Class1 then I could access the instance of Class1 through Class2, but I need to create an instance of Class0 on some main() function, which disallows me access the Class1 methods.
Class1. Maybe pass one as an argument tobar?Class1tobar()as an argument?__init__, and haveClass2store an instance ofClass1.