- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSpeed.py
More file actions
Latest commit
28 lines (20 loc) · 781 Bytes
/
Copy pathSpeed.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
importspeedtest
fromtabulateimporttabulate
st=speedtest.Speedtest()
classNetwork(object):
def__init__(self):
self.parser=speedtest.Speedtest()
defdata(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()
returntabulate(speed, headers="firstrow", tablefmt="fancy_grid")
if__name__=="__main__":
print("Your Networ Speed Is : ")
print(Network())
print(" Mbps")