Staging
v0.8.1
Revision 73cdff47b2ff80e38da49bb42e68646ae1d4f190 authored by Anthony Baxter on 23 March 2006, 02:49:35 UTC, committed by Anthony Baxter on 23 March 2006, 02:49:35 UTC
1 parent e311fdc
Raw File
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