Global Imp

global import context manager

Global Context Manager

/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/fastcore/docscrape.py:225: UserWarning: Unknown section Notes
  else: warn(msg)

source

GImp

 GImp ()
with GImp() as gimp:
    
    import os, signal, atexit, threading, _thread
    # whatever you want it won't remain local
    # if only 
    gimp()
    # is called before the end of this block

# there you go: use os, signal, ... from whatever place of the module