Created
September 15, 2021 06:53
-
-
Save Priler/dd8dc0c30e29312c5a9ea87a3ba5f501 to your computer and use it in GitHub Desktop.
Check internet speed in Python
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
from rich import print | |
from rich.console import Console | |
from speedtest import Speedtest | |
console = Console() | |
st = Speedtest() | |
with console.status("[bold green]Замеряю скорость интернета...") as status: | |
dl_speed = int(st.download() / 8000) | |
up_speed = int(st.upload() / 8000) | |
print(f"[bold bright_blue]Скорость закачки: {dl_speed} kb/s[/bold bright_blue]\\\ | |
\n[bold red3]Скорость выгрузки: {up_speed} kb/s[/bold red3]") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment