File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
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 )
Original file line number Diff line number Diff line change
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, \n Upload 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 )
You can’t perform that action at this time.
0 commit comments