我收到了这个错误,无法弄清楚它出错的地方。我之前没有在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
答案 0 :(得分:2)
你拼错了__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)