SPEEDTEST PYTHON PROJECT
#pip install speedtest-cli
from speedtest import Speedtest
"""
Ping (ms): ping of the test connection, in miliseconds
Download (Mb/s): download speed recorded, in megabits per second
Upload (Mb/s): upload speed recorded, in megabits per second
"""
print("Checking...")
st = Speedtest()
#For Checking Upload and Download
dn = st.download()
up = st.upload()
print("Your Download Speed====>",dn,"Kb/s")
print("Your Upload Speed=======>",up,"Kb/s")
#Now Convert Data into Megabits --
print("Your Download Speed in Megabits====>",round(dn/10**6,2),"Mb/s")
print("Your Upload Speed in Megabits=======>",round(up/10**6,2),"Mb/s")
#Speed ====> 7Mb/s == 1MB/s
#Now Convert Data into MegaBytes---
print("Your Download Speed in MegaBytes====>",(dn/10**6)/7,"MB/s")
print("Your Upload Speed in MegaBytes=======>",(up/10**6)/7,"MB/s")
#Also Calculate Ping---
# Get ping (miliseconds)
ping = st.results.ping
print("Ping in Milliseonds===>",ping,"/millisecond")
print("Ping in seonds===>",ping/10**3,"/second")
Ok
ReplyDelete