summaryrefslogtreecommitdiffstats
path: root/Demo/sockets/throughput.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/throughput.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/throughput.py')
-rwxr-xr-xDemo/sockets/throughput.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Demo/sockets/throughput.py b/Demo/sockets/throughput.py
index b8df1f3..64244aa 100755
--- a/Demo/sockets/throughput.py
+++ b/Demo/sockets/throughput.py
@@ -33,8 +33,8 @@ def main():
def usage():
sys.stdout = sys.stderr
- print 'Usage: (on host_A) throughput -s [port]'
- print 'and then: (on host_B) throughput -c count host_A [port]'
+ print('Usage: (on host_A) throughput -s [port]')
+ print('and then: (on host_B) throughput -c count host_A [port]')
sys.exit(2)
@@ -46,7 +46,7 @@ def server():
s = socket(AF_INET, SOCK_STREAM)
s.bind(('', port))
s.listen(1)
- print 'Server ready...'
+ print('Server ready...')
while 1:
conn, (host, remoteport) = s.accept()
while 1:
@@ -56,7 +56,7 @@ def server():
del data
conn.send('OK\n')
conn.close()
- print 'Done with', host, 'port', remoteport
+ print('Done with', host, 'port', remoteport)
def client():
@@ -82,12 +82,12 @@ def client():
t4 = time.time()
data = s.recv(BUFSIZE)
t5 = time.time()
- print data
- print 'Raw timers:', t1, t2, t3, t4, t5
- print 'Intervals:', t2-t1, t3-t2, t4-t3, t5-t4
- print 'Total:', t5-t1
- print 'Throughput:', round((BUFSIZE*count*0.001) / (t5-t1), 3),
- print 'K/sec.'
+ print(data)
+ print('Raw timers:', t1, t2, t3, t4, t5)
+ print('Intervals:', t2-t1, t3-t2, t4-t3, t5-t4)
+ print('Total:', t5-t1)
+ print('Throughput:', round((BUFSIZE*count*0.001) / (t5-t1), 3), end=' ')
+ print('K/sec.')
main()