【发布时间】:2015-06-10 09:17:20
【问题描述】:
我有一个关于 python 类的快速问题。 以下是设置: 我有一个类作为“策划者”类,其中包含其他类的各种实例。现在这些类需要调用另一个类的方法,但我不知道该怎么做。例如:
class mastermind(object):
def __init__(self):
self.hand = hand()
def iNeedToCallThisMethod(self, funzies):
print funzies
class hand(object):
def __init(self):
pass #here should be a call to the mastermind instance's method
example = mastermind()
希望你们能帮我解决这个问题,我的大脑正在冒热气!非常感谢!
【问题讨论】:
标签: python class python-2.7 oop methods