Created
March 7, 2021 09:30
-
-
Save theDreamer911/2d2acc83e3614c4cab3f757e5abd216b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import speedtest | |
speed = speedtest.Speedtest() | |
def main(): | |
while True: | |
print('\a') | |
choice=int(input("""Check Your Connection Speed | |
1) Download Speed | |
2) Upload Speed | |
3) Exit | |
Choice (1/2/3): """)) | |
print('\a') | |
if choice==1: | |
print('Counting...') | |
print(f"Download speed: {'{:.2f}'.format(speed.download()/1024/1024)} Mb/s") | |
elif choice==2: | |
print('Counting...') | |
print(f"Upload speed: {'{:.2f}'.format(speed.upload()/1024/1024)} Mb/s") | |
elif choice==3: | |
print('Exiting the program') | |
quit() | |
else: | |
print("Please choose the correct options") | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment