Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check network bandwidth with Python? [closed]

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?

like image 829
czaaja Avatar asked Feb 19 '11 11:02

czaaja


1 Answers

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.

like image 77
Frédéric Hamidi Avatar answered Sep 27 '22 16:09

Frédéric Hamidi