Skip to content

Instantly share code, notes, and snippets.

View bczsalba's full-sized avatar
💭
cosmic gekko

Balázs Cene bczsalba

💭
cosmic gekko
View GitHub Profile
@bczsalba
bczsalba / get_caller.py
Created May 10, 2025 22:01
python function to get information about caller frames at any given level
def get_caller(depth: int = 1):
"""Returns the caller frame at the given depth."""
import inspect
from collections import namedtuple
frame = inspect.currentframe()
assert frame is not None
if frame.f_back is None:
@bczsalba
bczsalba / ANSI.md
Last active May 5, 2021 21:36 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27