Skip to content

Instantly share code, notes, and snippets.

@obfusk
Last active Jun 27, 2022
Embed
What would you like to do?
python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
import code; code.interact(local=dict(globals(), **locals()))
@charterchap
Copy link

charterchap commented Sep 3, 2021

def pry():
    import inspect
    frame = inspect.currentframe().f_back
    try:
        import code; 
        code.interact(local=dict(frame.f_globals, **frame.f_locals))
    finally:
        del frame

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment