summaryrefslogtreecommitdiffstats
path: root/Demo/sockets/udpecho.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 (GMT)
committerCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 (GMT)
commit6f2df4d5e193d54244b0c2de91ef0ab1604b9243 (patch)
tree5e172400da7561eb4bb8fafc62c8cab511d74dad /Demo/sockets/udpecho.py
parenta8c360ee76fb76902a2e2140fbb38d4b06b2d9fb (diff)
downloadcpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.zip
cpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.gz
cpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.bz2
Run 2to3 over the Demo/ directory to shut up parse errors from 2to3 about lingering print statements.
Diffstat (limited to 'Demo/sockets/udpecho.py')
-rwxr-xr-xDemo/sockets/udpecho.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Demo/sockets/udpecho.py b/Demo/sockets/udpecho.py
index 5181c82..8a6bd21 100755
--- a/Demo/sockets/udpecho.py
+++ b/Demo/sockets/udpecho.py
@@ -23,8 +23,8 @@ def main():
def usage():
sys.stdout = sys.stderr
- print 'Usage: udpecho -s [port] (server)'
- print 'or: udpecho -c host [port] <file (client)'
+ print('Usage: udpecho -s [port] (server)')
+ print('or: udpecho -c host [port] <file (client)')
sys.exit(2)
def server():
@@ -34,10 +34,10 @@ def server():
port = ECHO_PORT
s = socket(AF_INET, SOCK_DGRAM)
s.bind(('', port))
- print 'udp echo server ready'
+ print('udp echo server ready')
while 1:
data, addr = s.recvfrom(BUFSIZE)
- print 'server received %r from %r' % (data, addr)
+ print('server received %r from %r' % (data, addr))
s.sendto(data, addr)
def client():
@@ -51,13 +51,13 @@ def client():
addr = host, port
s = socket(AF_INET, SOCK_DGRAM)
s.bind(('', 0))
- print 'udp echo client ready, reading stdin'
+ print('udp echo client ready, reading stdin')
while 1:
line = sys.stdin.readline()
if not line:
break
s.sendto(line, addr)
data, fromaddr = s.recvfrom(BUFSIZE)
- print 'client received %r from %r' % (data, fromaddr)
+ print('client received %r from %r' % (data, fromaddr))
main()