Skip to content

Instantly share code, notes, and snippets.

@Priler
Created September 15, 2021 06:53
Show Gist options
  • Save Priler/dd8dc0c30e29312c5a9ea87a3ba5f501 to your computer and use it in GitHub Desktop.
Save Priler/dd8dc0c30e29312c5a9ea87a3ba5f501 to your computer and use it in GitHub Desktop.
Check internet speed in Python
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