mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-23 20:11:07 +00:00
Created a Speed checking script in python 3 named TestMyInternetSpeed (#214)
* speedtest using python
* main python script for checking speeds
* Add files via upload
* Delete TestMySpeed.py
* Delete requirements.txt
* Delete README.md
* Update README.md
* Update README.md
* Revert "Delete README.md"
This reverts commit 8d14c3b3e6
.
reverted the accidentally commited readme file commit
* added the readme file i deleted accidentally
* Update README.md
Co-authored-by: Dhruv Bansal <dhruvbansal@Dhruvs-MacBook-Air.local>
This commit is contained in:
parent
657ce07b97
commit
c34cbb6b73
|
@ -1,4 +1,4 @@
|
||||||
# Awesome Python Scripts :sunglasses: <img alt="PyPI" src="https://warehouse-camo.cmh1.psfhosted.org/18509a25dde64f893bd96f21682bd6211c3d4e80/68747470733a2f2f696d672e736869656c64732e696f2f707970692f707976657273696f6e732f64796e61636f6e662e737667"> [![HitCount](http://hits.dwyl.io/hastagAB/Awesome-Python-Scripts.svg)](http://hits.dwyl.io/hastagAB/Awesome-Python-Scripts) ![GitHub stars](https://img.shields.io/github/stars/hastagAB/Awesome-Python-Scripts?style=social)
|
# Awesome Python Scripts :sunglasses: <img alt="PyPI" src="https://warehouse-camo.cmh1.psfhosted.org/18509a25dde64f893bd96f21682bd6211c3d4e80/68747470733a2f2f696d672e736869656c64732e696f2f707970692f707976657273696f6e732f64796e61636f6e662e737667"> [![HitCount](http://hits.dwyl.io/hastagAB/Awesome-Python-Scripts.svg)](http://hits.dwyl.io/hastagAB/Awesome-Python-Scripts) ![GitHub stars](https://img.shields.io/github/stars/hastagAB/Awesome-Python-Scripts?style=social)
|
||||||
|
|
||||||
## What is this repo?
|
## What is this repo?
|
||||||
This repo is a compilation of some *awesome* Python scripts that automate some boring tasks or simply make our life easier...or both!
|
This repo is a compilation of some *awesome* Python scripts that automate some boring tasks or simply make our life easier...or both!
|
||||||
|
@ -174,7 +174,7 @@ So far, the following projects have been integrated to this repo:
|
||||||
|[Rock-Paper-Scissor Game](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Rock-Paper-Scissor)|[Punit Sakre](https://github.com/punitsakre23)|
|
|[Rock-Paper-Scissor Game](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Rock-Paper-Scissor)|[Punit Sakre](https://github.com/punitsakre23)|
|
||||||
|[Folder Locker and hider](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Folder%20Locker%20%26%20Hider)|[Prajjwal Pathak](https://github.com/pyguru123)|
|
|[Folder Locker and hider](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Folder%20Locker%20%26%20Hider)|[Prajjwal Pathak](https://github.com/pyguru123)|
|
||||||
|[Image Compressor](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Image_Compressor)|[Prathima Kadari](https://github.com/prathimacode-hub)|
|
|[Image Compressor](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Image_Compressor)|[Prathima Kadari](https://github.com/prathimacode-hub)|
|
||||||
|
|[Test Your Internet Speed](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/TestMyInternetSpeed)|[TheSmartDeveloperr](https://github.com/thesmartdeveloperr)|
|
||||||
|
|
||||||
## How to use :
|
## How to use :
|
||||||
|
|
||||||
|
|
20
TestMyInternetSpeed/README.md
Normal file
20
TestMyInternetSpeed/README.md
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
## Test Your Internet Speed using Python
|
||||||
|
<img src="https://b.cdnst.net/images/share-logo.png"
|
||||||
|
alt="speedtest image"/>
|
||||||
|
|
||||||
|
This is a simple but powerful and efficient python program.
|
||||||
|
You can test your internet bandwidth speed with this script i wrote using just a single command, you will also get a bunch of good options to choose from and the test will be performed with the help of speedtest-cli module in python.
|
||||||
|
|
||||||
|
- Test Download Speed
|
||||||
|
- Test Upload Speed
|
||||||
|
- Test Server Pings
|
||||||
|
- Results in Mbps(Mega bits per second)
|
||||||
|
|
||||||
|
#### How to use
|
||||||
|
|
||||||
|
- Clone the repo or download the zip
|
||||||
|
- Navigate to the folder of the program in terminal/cmd.
|
||||||
|
- Install the dependencies using pip install -r requirements.txt
|
||||||
|
- Run the command python TestMySpeed.py
|
||||||
|
|
||||||
|
(Note: You will need to have python 3 installed and if you are on a unix based OS (macOS, or linux) you may need to run the command using python3 TestMySpeed.py)
|
43
TestMyInternetSpeed/TestMySpeed.py
Normal file
43
TestMyInternetSpeed/TestMySpeed.py
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
|
||||||
|
# the package used is speedtest-cli(it is the only package we need)
|
||||||
|
import speedtest
|
||||||
|
from time import sleep
|
||||||
|
speed=speedtest.Speedtest()
|
||||||
|
|
||||||
|
option=int(input('''
|
||||||
|
What do you want to know:
|
||||||
|
1) Download speed
|
||||||
|
2) Upload speed
|
||||||
|
3) Both Download and Upload
|
||||||
|
4) Ping
|
||||||
|
Your choice: '''))
|
||||||
|
|
||||||
|
if option<1 or option>4:
|
||||||
|
sleep(2)
|
||||||
|
print('You have entered wrong choice, please enter again with values from 1 to 4')
|
||||||
|
else:
|
||||||
|
sleep(1)
|
||||||
|
print()
|
||||||
|
print('Pls wait, test in progress...')
|
||||||
|
print()
|
||||||
|
down_speed=round(speed.download()/1000000,3)
|
||||||
|
up_speed=round(speed.upload()/1000000,3)
|
||||||
|
print('One more sec please...')
|
||||||
|
sleep(2.5)
|
||||||
|
print()
|
||||||
|
if option == 1:
|
||||||
|
print('Your Download speed is: ',down_speed,'Mbps')
|
||||||
|
elif option == 2:
|
||||||
|
print('Your Upload speed is: ',up_speed,'Mbps')
|
||||||
|
elif option == 3:
|
||||||
|
print('Your Download speed is: ',down_speed,'Mbps',end=" ")
|
||||||
|
print(',and your Upload speed is: ',up_speed,'Mbps')
|
||||||
|
|
||||||
|
elif option == 4:
|
||||||
|
s=[]
|
||||||
|
speed.get_servers(s)
|
||||||
|
print(speed.results.ping,'ms')
|
||||||
|
else:
|
||||||
|
print('Sorry, something went wrong, pls try again...')
|
||||||
|
|
||||||
|
|
1
TestMyInternetSpeed/requirements.txt
Normal file
1
TestMyInternetSpeed/requirements.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
speedtest-cli
|
Loading…
Reference in New Issue
Block a user