Skip to content

Commit 34906c3

Browse files
authored
V 1.0
0 parents  commit 34906c3

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

bandwith.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from distutils.command.upload import upload
2+
import speedtest
3+
from time import sleep
4+
speed = speedtest.Speedtest()
5+
option = int(input('''Select your option:
6+
1. Download speed⬇
7+
2. Upload speed⬆
8+
3. Download & Upload speed ↕
9+
4. Ping᭼
10+
'''))
11+
if option < 1 or option > 4:
12+
sleep(2)
13+
print('🤖 Sorry, you have entered the wrong option')
14+
else:
15+
sleep(1)
16+
print()
17+
print('Please wait test in progress...⌛️')
18+
download_speed = round(speed.download()/1000000, 3)
19+
upload_speed = round(speed.upload()/1000000, 3)
20+
print('One moment please 🙂')
21+
sleep(2.5)
22+
print()
23+
if option == 1:
24+
print(f'The download speed is ', download_speed, ' Mbps')
25+
elif option == 2:
26+
print(f'The upload speed is ', upload_speed, ' Mbps')
27+
elif option == 3:
28+
print(f'The download speed is ', download_speed,
29+
' Mbps and \n the upload speed is ', upload_speed)
30+
elif option == 4:
31+
s = [] # empty list
32+
speed.get_servers(s)
33+
print('Your ping is ', speed.results.ping, ' ms')
34+
else:
35+
print('🤖uhuh, something went wrong please try again')

0 commit comments

Comments
 (0)