|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
class Task:
image_window_list = []
def setId(self,Id):
self.Id = Id
def setNoDownlink(self,NoDownlink):
self.setNoDownlink = NoDownlink
def setTaskRequest(self,task_request):
self.setTaskRequest = task_request
def setTaskProperty(self,task_property):
self.setTaskProperty = task_property
def setTarget(self,task_target):
self.setTarget = task_target
def getImageWindowList(self,window):
self.getImageWindowList = Task.image_window_list.append(window)
a = Task()
window1 = 1
window2 = 2
print(type(window1))
print(type(window2))
a.getImageWindowList(window1)
a.getImageWindowList(window2)
print(a.image_window_list)
求问大佬,为啥a.getImageWindowList(window2)这一行会报TypeError: 'NoneType' object is not callable这个错误?
class Task:
image_window_list = []
def setId(self,Id):
self.Id = Id
def setNoDownlink(self,NoDownlink):
self.setNoDownlink = NoDownlink
def setTaskRequest(self,task_request):
self.setTaskRequest = task_request
def setTaskProperty(self,task_property):
self.setTaskProperty = task_property
def setTarget(self,task_target):
self.setTarget = task_target
def getImageWindowList(self,window):
Task.image_window_list.append(window) # 这一行代码,你把 getImageWindowList 方法重新赋值了,而 append 的返回值是 None
a = Task()
window1 = 1
window2 = 2
print(type(window1))
print(type(window2))
a.getImageWindowList(window1)
a.getImageWindowList(window2)
print(a.image_window_list)
|
|