[英]Calling method from a class in a different class in python
假設我有這段代碼:
class class1(object):
def __init__(self):
#don't worry about this
def parse(self, array):
# do something with array
class class2(object):
def __init__(self):
#don't worry about this
def parse(self, array):
# do something else with array
我希望能夠從class2調用class1的解析,反之亦然。 我知道用c ++這可以很容易地完成
class1::parse(array)
我如何在python中做相同的操作?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.