Staging
v0.5.1
https://github.com/python/cpython
Revision b3570e83e5da8bc51d7167bd55bb9aa42a033032 authored by cvs2svn on 02 March 2001, 19:48:06 UTC, committed by cvs2svn on 02 March 2001, 19:48:06 UTC
1 parent 80d4c07
Raw File
Tip revision: b3570e83e5da8bc51d7167bd55bb9aa42a033032 authored by cvs2svn on 02 March 2001, 19:48:06 UTC
This commit was manufactured by cvs2svn to create tag 'r21b1'.
Tip revision: b3570e8
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(`wherefrom` + '\n')
	sys.stdout.write(data)
back to top