Skip to content

Instantly share code, notes, and snippets.

@bhuiyanmobasshir94
Created September 15, 2023 02:07
Show Gist options
  • Save bhuiyanmobasshir94/7656afd1a2b2d0a5c5c6760f2929e14e to your computer and use it in GitHub Desktop.
Save bhuiyanmobasshir94/7656afd1a2b2d0a5c5c6760f2929e14e to your computer and use it in GitHub Desktop.
import speedtest
def check_speed():
st = speedtest.Speedtest()
download_speed = st.download() / 10**6 # Convert to Mbps
upload_speed = st.upload() / 10**6 # Convert to Mbps
print(f"Download Speed: {download_speed:.2f} Mbps")
print(f"Upload Speed: {upload_speed:.2f} Mbps")
if __name__ == "__main__":
check_speed()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment