Contamos con la solución a esta traba, al menos eso deseamos. Si tienes inquietudes puedes dejarlo en el apartado de comentarios, que sin tardar
Ejemplo 1: prueba de velocidad de Internet con python
#first install the mosule
pip install speedtest-cli
#make sure evry thing is good
speedtest-cli --version
#speed test
speedtest-cli
#in bytes
speedtest-cli --bytes#if you want a picture to shate
speedtest-cli --share
Ejemplo 2: speedtest py
#pip3 install speedtest-cliimport speedtest
#function that gets the download speed in mega bytes per seconddefget_final_speed():
rawspeed = speedtest.Speedtest().download()
roundedspeed =round(rawspeed)
finalspeed = roundedspeed /1e+6return finalspeed
#function that finds the average downloadspeed in mega bytes a seconddeflooped_av(y):
finalspeeds =0for i inrange(y):
x = get_final_speed()
speeds =0
count =0
count +=1
speeds += x
print(f'i+1. xmb/s')
finalspeeds = speeds/count
return finalspeeds
#menu loopwhileTrue:
repeat =input('1, 2, 3 or press ENTER to quitn>>>')if repeat =='1':#single iteration
x = get_final_speed()print(f'done, your download speed is xmb/s')elif repeat =='2':#2 iterations and finds the average speed
x = looped_av(2)print(f'done, your average download speed is xmb/s')elif repeat =='3':#finds out how accurate the user wants the average to be, pretty pointless i know
times_through =int(input('how many times do you want the test to run?n>>>'))#iterates and finds the average download speed
x = looped_av(times_through)print(f'done, your average download speed is xmb/s')else:#breaks from the loopbreak
Aquí puedes ver las comentarios y valoraciones de los usuarios
Te invitamos a añadir valor a nuestra información tributando tu experiencia en las observaciones.
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)