[英]AssertionError: python threading
我收到此错误,无法弄清楚它出错的地方。 我以前没有在python中做过线程。
class ClientThread(threading.Thread):
def __int__(self,ip,port,socket):
threading.Thread.__int__(self)
self.ip = ip
self.port = port
self.socket = socket
print "New thread started for "+ip+":"+str(port)
def run(self):
....
....
(clientsock, (ip,port)) = serverSocket.accept()
# Create new thread
newthread = ClientThread(ip,port,clientsock)
....
....
这是我得到的错误。
newthread = ClientThread(ip,port,clientsock)
AssertionError: group argument must be None for now
你拼错了__init__
。 另外我建议使用新的样式继承。
class ClientThread(threading.Thread):
def __init__(self, ip, port, socket):
super(ClientThread, self).__init__()
self.ip = ip
self.port = port
self.socket = socket
print "New thread started for "+ip+":"+str(port)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.