Skip to content
This repository was archived by the owner on Dec 22, 2023. It is now read-only.

Commit bab929d

Browse files
committed
Python script that provides the download and upload speed of your Wifi
1 parent dac44fb commit bab929d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Scripts/Miscellaneous/wifiSpeed.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Python script that provides the download and upload speed of your Wifi.
2+
3+
# Python module for testing internet bandwidth
4+
import speedtest
5+
6+
# Creating a instance
7+
s = speedtest.Speedtest()
8+
9+
# Menu
10+
print("Select a valid option from below:\n")
11+
print("1. Download")
12+
print("2. Upload")
13+
print("3. Exit\n")
14+
15+
# Run until valid option is selected
16+
while True:
17+
# Getting options from user
18+
option = int(input("Enter Option: "))
19+
20+
if option == 1:
21+
download = s.download() / 1000
22+
print(f"\nDownload Speed : %.2f kb/s" % download)
23+
break
24+
elif option == 2:
25+
upload = s.upload() / 1000
26+
print(f"\nUpload Speed : %.2f kb/s" % upload)
27+
break
28+
elif option == 3:
29+
print("\nExiting Successfully...")
30+
break
31+
else:
32+
print("\nINVALID OPTION SELECTED! Re-", end = "")

0 commit comments

Comments
 (0)