Skip to content

Commit ade5639

Browse files
added Script to check wifi speed
1 parent 08b7bdd commit ade5639

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

Wifi_Speed/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Wifi Speed Tester
2+
This python script is used to print and notify the wifi **download speed, upload speed and the ping** to test the internet connection.
3+
4+
## Packages Used
5+
- speedtest
6+
- win10toast
7+
8+
## Snapshot:
9+
![](https://snipboard.io/0BLA5V.jpg)

Wifi_Speed/wifi_speed.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# importing requiered modules
2+
import win10toast
3+
import speedtest
4+
5+
st = speedtest.Speedtest()
6+
7+
# download speed
8+
download = st.download() / 1048576
9+
10+
# upload speed
11+
upload = st.upload() / 1048576
12+
servernames = []
13+
names = st.get_servers(servernames)
14+
15+
# ping
16+
ping = st.results.ping
17+
18+
# storing the values in a list
19+
data = [download, upload, ping]
20+
formated_data = ["%.2f" % elem for elem in data]
21+
22+
# creating a message for the notification
23+
message = "Download Speed: {}Mbps, \nUpload Speed: {}Mbps,\n Ping: {}ms".format(
24+
*formated_data
25+
)
26+
27+
# creating a notification window
28+
toaster = win10toast.ToastNotifier()
29+
30+
# printing the data
31+
print(message)
32+
33+
# displaying the notification
34+
toaster.show_toast("Wifi Speedtest Successfull!", message, duration=20)

0 commit comments

Comments
 (0)