私は2つのクラスを持っています。オブジェクト指向の方法論では、下位クラスから親属性を変更できます。Pythonでは、親の変数を他のクラスから変更するにはどうすればよいですか? 私が持っているもの
class Concurrent( threading.Thread):
def __init__(self):
self.rec = Rec()
self.rec.start()
self.parentvar = None # I have change this variable
self.secondParentVar = [] # or use this
class Rec(Concurrent):
def run(self):
# from here, change variable of the parent Conccurent class variable