Created
June 9, 2020 15:18
-
-
Save mohangowda-dev/04cccbb49b5f562110292297b509de15 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
| # Before You run the code open your cmd and use pip to install a package called speedtest-cli | |
| # run the code [" pip install speedtest-cli "] in cmd | |
| # Python program to test | |
| # internet speed | |
| import speedtest | |
| st = speedtest.Speedtest() | |
| option = int(input('''What speed do you want to test: | |
| 1) Download Speed | |
| 2) Upload Speed | |
| 3) Ping | |
| 4) All the three | |
| Your Choice: ''')) | |
| if option == 1: | |
| d = st.download() | |
| d = d/1000000 | |
| print("Download : ",d) | |
| elif option == 2: | |
| u = st.upload() | |
| u = u/1000000 | |
| print("Upload : ",u) | |
| elif option == 3: | |
| servernames =[] | |
| st.get_servers(servernames) | |
| p = st.results.ping | |
| print("Ping : ",p) | |
| elif option == 4: | |
| d = st.download() | |
| d = d / 1000000 | |
| print("Download : ", d) | |
| u = st.upload() | |
| u = u/1000000 | |
| print("Upload : ",u) | |
| servernames =[] | |
| st.get_servers(servernames) | |
| p = st.results.ping | |
| print("Ping : ",p) | |
| else: | |
| print("Please enter the correct choice !") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment