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

Commit 601c5bc

Browse files
authored
Merge pull request #42 from AdeshChoudhar19/master
Python script that provides the download and upload speed of your Wifi
2 parents dac44fb + c784fea commit 601c5bc

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Python script that provides the download and upload speed of your Wifi
2+
A simple Python script that uses 'speedtest' module to test the internet bandwidth of your connection.
3+
4+
### Prerequisites
5+
You will need to install speedtest module.
6+
The installation commands are provided in requirements.txt
7+
8+
### How to run the script
9+
First you have to go to the Wifi_Speed directory. Run the following command once you are in project directory
10+
11+
```cd Scripts/Miscellaneous/Wifi_Speed```
12+
13+
For Python 3: ```python3 wifiSpeed.py```
14+
For Python 2: ```python wifiSpeed.py```
15+
16+
### Screenshot/GIF showing the sample use of the script
17+
![Screenshot](Screenshot.png)
18+
19+
## *Author Name*
20+
Adesh Choudhar
58.6 KB
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
speedtest-cli==2.1.2
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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"Download Speed : %.2f kb/s\n" % download)
23+
elif option == 2:
24+
upload = s.upload() / 1000
25+
print(f"Upload Speed : %.2f kb/s\n" % upload)
26+
elif option == 3:
27+
print("\nExiting Successfully...")
28+
break
29+
else:
30+
print("INVALID OPTION SELECTED! Re-", end = "")

0 commit comments

Comments
 (0)