class a:
def __init__(self):
b
def c(self):
d(e)
def d(self,g):
print 1
I'm wondering what I should do if I want to use function d in function c as it turns that "global name d is not defined.". Thank you.
d
是一个实例方法,因此您使用self.d()
调用它。
你必须从你的函数调用self.d()
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.