Skip to content

Instantly share code, notes, and snippets.

@LeoHuckvale
LeoHuckvale / env-context.py
Last active March 20, 2023 11:09 — forked from igniteflow/env-context.py
A Python context manager for setting/unsetting environment variables
"""
Environment variable context manager
------------------------------------
Support utility for managing environments in which e.g. git is run
"""
import os
from contextlib import contextmanager
from functools import wraps
@LeoHuckvale
LeoHuckvale / cSpinner.py
Created October 12, 2015 11:15 — forked from kxtells/cSpinner.py
Rotating Stick Class for Python
import sys
import threading
import time
class cSpinner(threading.Thread):
"""
Print things to one line dynamically
"""
chars = ["\\","|","/","-"]
index = 0