[bglug] Utilizzo della banda da linea di comando?
Andrea Campanella
emuboy85@gmail.com
Ven 5 Ago 2011 09:58:33 CEST
Per i posteri:
---------------------------------------------------------->8-------------------------------------------------------------------------
import os
import time
for line in os.popen('cat /sys/class/net/eth0/statistics/rx_bytes'):
BR1 = line
for line in os.popen('cat /sys/class/net/eth0/statistics/tx_bytes'):
BT1 = line
time.sleep(30)
for line in os.popen('cat /sys/class/net/eth0/statistics/rx_bytes'):
BR2 = line
for line in os.popen('cat /sys/class/net/eth0/statistics/tx_bytes'):
BT2 = line
rx = ((((int(BR2)-int(BR1))/30)/1024))
tx = ((((int(BT2)-int(BT1))/30)/1024))
print rx
print tx
---------------------------------------------------------->8-------------------------------------------------------------------------
--
Andrea "emuboy" Campanella
emuboy.homelinux.com
Maggiori informazioni sulla lista
bglug