Hi!
For some reason, the following seems to work perfectly on my ubuntu machine running python 2.6 and returns an error on my windows xp box running python 3.1
from socket import socket, AF_INET, SOCK_DGRAM
data = 'UDP Test Data'
port = 12345
hostname = '192.168.0.1'
udp = socket(AF_INET,SOCK_DGRAM)
udp.sendto(data, (hostname, port))
Below is the error that the python 3.1 throws:
Traceback (most recent call last):
File "sendto.py", line 6, in <module>
udp.sendto(data, (hostname, port))
TypeError: sendto() takes exactly 3 arguments (2 given)
I have consulted the documentation for python 3.1 and the sendto() only requires two parameters. Any ideas as to what may be causing this?