-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSpeed.py
More file actions
28 lines (20 loc) · 781 Bytes
/
Speed.py
File metadata and controls
28 lines (20 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import speedtest
from tabulate import tabulate
st=speedtest.Speedtest()
class Network(object):
def __init__(self):
self.parser = speedtest.Speedtest()
def data(self):
down = str(f"{round(self.parser.download() / 1_000_000 , 2)} Mbps")
up = str(f"{round(self.parser.upload() / 1_000_000, 2)} Mbps")
servernames =[]
st.get_servers(servernames)
png=st.results.ping
return [["Interface" , "Download", "Upload","Ping"],["JioFi2_06CE6B",down,up,png]]
def __repr__(self):
speed = self.data()
return tabulate(speed, headers="firstrow", tablefmt="fancy_grid")
if __name__ == "__main__":
print("Your Networ Speed Is : ")
print(Network())
print(" Mbps")