Staging
v0.5.1
https://github.com/python/cpython
Revision 7a41638b5b183d0b9b27449d502d0a15001134ee authored by Benjamin Peterson on 04 April 2020, 16:54:14 UTC, committed by Benjamin Peterson on 04 April 2020, 16:54:14 UTC
1 parent c6bfd04
Raw File
Tip revision: 7a41638b5b183d0b9b27449d502d0a15001134ee authored by Benjamin Peterson on 04 April 2020, 16:54:14 UTC
Bump version to 2.7.18rc1.
Tip revision: 7a41638
radio.py
# Receive UDP packets transmitted by a broadcasting service

MYPORT = 50000

import sys
from socket import *

s = socket(AF_INET, SOCK_DGRAM)
s.bind(('', MYPORT))

while 1:
    data, wherefrom = s.recvfrom(1500, 0)
    sys.stderr.write(repr(wherefrom) + '\n')
    sys.stdout.write(data)
back to top