How to check network bandwidth with Python? [closed]

ぃ、小莉子 提交于 2019-12-23 09:36:16

问题


As asked, I would like my script to check network bandwidth giving me any idea how fast user can surf through web. Is there any library, which allows me to specify size of package to be send and gives ping time or whatever?


回答1:


This answer mentions a Python implementation of ping that returns the ICMP packet's round-trip time. You can use the improved code from the comment: https://gist.github.com/255009.

But note that since it uses raw sockets, your Python script will need to run as root.



来源:https://stackoverflow.com/questions/5050405/how-to-check-network-bandwidth-with-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!