Merge e6ae58464e
into 6603954e45
This commit is contained in:
commit
a936d8ea72
15
README.rst
15
README.rst
|
@ -71,6 +71,21 @@ or
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
You can use in another script via the following:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
DownloadParsed = re.compile(r"Download: ([\d.]+) .bit")
|
||||||
|
UploadParsed = re.compile(r"Upload: ([\d.]+) .bit")
|
||||||
|
PingParsed = re.compile(r"([\d.]+) ms")
|
||||||
|
speedtest_result = str(subprocess.check_output(['speedtest-cli'], stderr=subprocess.STDOUT))
|
||||||
|
download = DownloadParsed.search(speedtest_result).group(1)
|
||||||
|
upload = UploadParsed.search(speedtest_result).group(1)
|
||||||
|
ping = PingParsed.search(speedtest_result).group(1)
|
||||||
|
print("Download Speed: " + download + " mbps\n" + "Upload Speed: " + upload + " mbps\n" + "Ping: " + ping + " ms")
|
||||||
|
|
||||||
|
You can use in terminal via the following:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
$ speedtest-cli -h
|
$ speedtest-cli -h
|
||||||
|
|
Loading…
Reference in New Issue