It is easy to create your own speedtest utility in Python. You will require Speedtest-CLI module to build your utility.
To install Speedtest-cli, run “pip install speedtest-cli” command
Once speedtest-cli is installed, import it into your Python file.
Following code will help you to find the best Speedtest server depending on your location
best_server = result.get_best_server()
Now, run the speed test for Download, Upload and ping result.
Using below code, you can covert the result in to Mbps and truncate the value to 2 decimal values
Print the output of your speed test result.
Hope you find it useful.
Disclaimer: www.TechieTalks.co.uk does not conceal the possibility of error and shortcomings due to human or technical factors. www.TechieTalks.co.uk does not bear responsibility upon any loss or damage arising from conduct or activities related to the use of data and information contained in this blog.
Comments
Post a Comment