tercer commit
[speedtestpy/.git] / spdtest.py
1 import speedtest
2 #first we need impot speedtest check it how you can do it in your OS
3
4 st = speedtest.Speedtest()
5
6 def testing(option,option1,option2):
7
8         if option == 1 and option1 == 2 and option2 == 3:
9                 mb=(st.download()*1.0E-6)
10                 print("Download speed:","{0:.2f}".format(mb),"mb")
11
12                 mb2=(st.upload()*1.0E-6)
13                 print("Upload  speed:","{0:.2f}".format(mb2),"mb")
14
15                 servernames =[]
16                 st.get_servers(servernames)
17                 print("Ping:",st.results.ping,'ms')
18
19         else:
20                 print("Please enter the correct choice!")
21
22 print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-")
23 print("Test in process please wait...")
24 testing(1,2,3)
25 print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-")