From d216974883d0a4338722e3c6567dc9fe19792687 Mon Sep 17 00:00:00 2001 From: Ronaldo89 <71316604+Ronaldo89@users.noreply.github.com> Date: Mon, 31 Oct 2022 18:50:58 +0200 Subject: [PATCH] Create Speedtest.py Speed test program --- Python/Speedtest.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Python/Speedtest.py diff --git a/Python/Speedtest.py b/Python/Speedtest.py new file mode 100644 index 0000000..64ddd82 --- /dev/null +++ b/Python/Speedtest.py @@ -0,0 +1,13 @@ +#install the required package +!pip install speedtest-cli +import speedtest + +speed_test = speedtest.Speedtest() + +def bytes_to_mb(bytes): + KB = 1024 #One kilobyte is 1024 bytes + MB = KB * 1024 # One MB is 1024KB + return int(bytes/MB) + +download_speed = bytes_to_mb(speed_test.download()) +print ("Your Download speed is ", download_speed, "MB" )