本篇博文主要介绍在Python3中如何构造含参构造函数
样例如下:
class MyOdlHttp:
username = ''
password = ''
def __init__(self, username, password):
self.username = username
self.password = password
print(username)
my_old_http = MyOdlHttp('admin', '123')