Skip to content

Instantly share code, notes, and snippets.

View Rayan25062011's full-sized avatar
💭
Working on Phusera repo

Mr.Baguette Rayan25062011

💭
Working on Phusera repo
  • Phusera
  • Space
View GitHub Profile
@erdemarslan
erdemarslan / Check Internet Connection.py
Last active July 6, 2022 05:29
Python check internet connection
import urllib3
def check_internet_conn():
http = urllib3.PoolManager(timeout=3.0)
r = http.request('GET', 'google.com', preload_content=False)
code = r.status
r.release_conn()
if code == 200:
return True
else:
@mikkkee
mikkkee / spinning_cursor.py
Created November 12, 2015 07:48
Spinning cursor and progress bar in console (Python)
"""
Create a spinning cursor or progress bar in terminal can be useful
for some scripts.
1. Use '\r' to move cursor back to the line beginning. Or use '\b'
to erase the last character.
2. The standard out of Python is buffered, which means it will
collect some data written to standard out before it actually
writes to the terminal.
The code snippet