# 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`
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:
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("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-")