3 pp = pprint.PrettyPrinter(indent=4)
4 #first we need impot speedtest check it how you can do it in your OS
6 st = speedtest.Speedtest()
7 st.get_servers(servers)
8 bestservers = st.get_best_server()
9 print("The best server found for this test is")
10 pp.pprint(bestservers)
11 def testing(option,option1,option2):
13 if option == 1 and option1 == 2 and option2 == 3:
14 mb=(st.download()*1.0E-6)
15 print("Download speed:","{0:.2f}".format(mb),"mb")
17 mb2=(st.upload()*1.0E-6)
18 print("Upload speed:","{0:.2f}".format(mb2),"mb")
21 st.get_servers(servernames)
22 print("Ping:",st.results.ping,'ms')
25 print("Please enter the correct choice!")
27 print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-")
28 print("Test in process please wait...")
30 print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-")