how to fill many data strings from socket.recvfrom()

lgwe larsgwest at gmail.com
Sat Nov 3 20:50:38 CET 2007


I want to receive 200 udp datagrams. Each into a new data string.
But I dont know how to do that, this is wrong:

import socket
s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
s.bind(("",port))
i = 0
while i<200:
    data[i],addr = s.recvfrom(1024)
    i = +1

data[i] is illegal.

Any suggestion welcome!




More information about the Python-list mailing list