> data[i] is illegal. > Any suggestion welcome! Either initialize data before: data=[0]*200 before "while" or (better): ... i=0 data=[] for i in range(200): d,addr= s.recvfrom(1024) data.append(d)