codekingpro/portable-devtools
114k
1"""Utilities for working with interactive environments."""2 3import sys4 5 6def is_interactive_env() -> bool:7 """Determine if running within IPython or Jupyter.8 9 Returns:10 `True` if running in an interactive environment, `False` otherwise.11 """12 return hasattr(sys, "ps2")13 