Ho questo pezzo di codice in cui provo a trasmettere un datagramma UDP in un'altra discussionePython: TypeError: argomento dopo * deve essere una sequenza
import threading, socket
address = ("localhost", 9999)
def send(sock):
sock.sendto("Message", address)
print "sent"
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
threading.Thread(target=send, args=(s)).start()
Ma quando provo a dare presa come argomento della funzione, un'eccezione TypeError viene lanciata:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in
self.__target(*self.__args, **self.__kwargs)
TypeError: send() argument after * must be a sequence, not _socketobject
che cosa significa?