i tried initialized the derived class by default superclass's __init__function, then i tried to use the global variable which initialized in the init function. but there was an error message said the variable "dr" in class One is not defined
base.py:
class Base(object):
dr = None
def __init__(self, driver):
global dr
dr = driver
one.py
class One(Base):
def fun(self):
print(dr)
if __name__=="__main__":
driver = 1
test = One(driver)
test.fun()