From: Josue Rodriguez Date: Sat, 17 Oct 2020 03:01:21 +0000 (-0400) Subject: Fixed description and code for this amazing project X-Git-Url: https://git.josue.xyz/?p=speedtestpy%2F.git;a=commitdiff_plain;h=14fe202bdb6cb9a42a620def53f580ab130ae161 Fixed description and code for this amazing project --- diff --git a/README.md b/README.md index cd36537..67d91f8 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,11 @@ # speedtestpy -using speedtest in python -to install speedtest first use: +## Running -debian : $ sudo apt-get install python-pip -arch : $ sudo pacman -S python-pip +1. Install pip: + + Debian : `$ sudo apt-get install python-pip` + + Arch : `$ sudo pacman -S python-pip` ~~Not mandatory~~ -then: - -debian : $ sudo pip install speedtest-cli -arch : $ sudo pacman -S speedtest-cli +1. Install python library: + + Debian : `$ sudo pip install speedtest-cli` + + Arch : `$ sudo pacman -S speedtest-cli` diff --git a/spdtest.py b/spdtest.py index e77b6dd..079f5d2 100644 --- a/spdtest.py +++ b/spdtest.py @@ -1,8 +1,13 @@ import speedtest +import pprint +pp = pprint.PrettyPrinter(indent=4) #first we need impot speedtest check it how you can do it in your OS - +servers = [] st = speedtest.Speedtest() - +st.get_servers(servers) +bestservers = st.get_best_server() +print("The best server found for this test is") +pp.pprint(bestservers) def testing(option,option1,option2): if option == 1 and option1 == 2 and option2 == 3: @@ -19,7 +24,7 @@ def testing(option,option1,option2): else: print("Please enter the correct choice!") -print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-") +print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-") print("Test in process please wait...") testing(1,2,3) -print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-") \ No newline at end of file +print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-")