ubuntu14中python发送和接收的字节数

2024-10-06 07:54:48 发布

您现在位置:Python中文网/ 问答频道 /正文

嗨,我的问题是python读取ubuntu14.10x64位中发送和接收的字节

我在osx中的功能代码是:

  #Network
    net = psutil.net_io_counters(pernic=True)
    sent = humanize.naturalsize(net['en0'].bytes_sent)
    received = humanize.naturalsize(net['en0'].bytes_recv)
    print(sent)
    print(received)

谢谢


Tags: 代码功能net字节bytesnetworkpsutilsent