X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=spdtest.py;h=079f5d29b3c6ba90784343c2a8f764cacc03f663;hb=HEAD;hp=76bfca989134533408817340d7956ed9024d1fbd;hpb=b94a867c1a60696059facaeebdc05da3dbf4c812;p=speedtestpy%2F.git diff --git a/spdtest.py b/spdtest.py index 76bfca9..079f5d2 100644 --- a/spdtest.py +++ b/spdtest.py @@ -1,22 +1,30 @@ 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): -def opciones(option,optione,optiones): - - if option == 1 and optione == 2 and optiones == 3: - #print(st.download(), 'b/s') + if option == 1 and option1 == 2 and option2 == 3: mb=(st.download()*1.0E-6) - print("Velocidad de bajada:","{0:.2f}".format(mb),"mb") - #print(st.upload(), 'b/s') + print("Download speed:","{0:.2f}".format(mb),"mb") + mb2=(st.upload()*1.0E-6) - print("Velocidad de subida:","{0:.2f}".format(mb2),"mb") + print("Upload speed:","{0:.2f}".format(mb2),"mb") + servernames =[] st.get_servers(servernames) print("Ping:",st.results.ping,'ms') + else: print("Please enter the correct choice!") -print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-") -print("Haciendo prueba de velocidad en Python") -opciones(1,2,3) -print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-") \ No newline at end of file +print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-") +print("Test in process please wait...") +testing(1,2,3) +print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-")