Created
September 15, 2023 02:07
-
-
Save bhuiyanmobasshir94/7656afd1a2b2d0a5c5c6760f2929e14e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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