Menu

YOU CAN TEST YOUR WI-FI SPEED USING PYTHON
📰

YOU CAN TEST YOUR WI-FI SPEED USING PYTHON

DEV Community: beginners·Sameer Qaiser·3 days ago
#DbJFDGJx
#devtobeginners#devto#dev#speedtest#python
Reading 0:00
15s threshold
Cover image for YOU CAN TEST YOUR WI-FI SPEED USING PYTHON

Sameer Qaiser

I was writing a tutorial on Python automation and realized I can test my internet speed without ever opening a browser.

If you have the speedtest-cli library installed, you can run this:

import speedtest

st = speedtest.Speedtest()
st.get_best_server()

print(f"Download: {st.download() / 1_000_000:.2f} Mbps")
print(f"Upload: {st.upload() / 1_000_000:.2f} Mbps")

Enter fullscreen mode Exit fullscreen mode

It runs in the background and gives you exact numbers. Super handy if you have a lot of smart home gadgets and want to check if your router is acting up.

What are some of your favorite small Python scripts for everyday tasks?