Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: f14c79b84f
Fetching contributors…

Cannot retrieve contributors at this time

executable file 33 lines (27 sloc) 0.606 kb
#!/usr/bin/python
import socket
import json
import time
while True:
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('', 6000))
data = sock.recv(10000)
sock.close()
#print data
stats = json.loads(data)
for k in stats:
v = stats[k]
if type(v) is list:
for i in range(0,len(v)):
print "%s[%d]: %f" % (k, i, v[i]['percent'])
else :
print "%s: %f" % (k,v['percent'])
print "----"
time.sleep(1)
except KeyboardInterrupt:
print "\nExiting..."
break
# except Exception as err:
# print "\nError ", type(err), ': ', err, "..."
# break
Jump to Line
Something went wrong with that request. Please try again.