Skip to content

Instantly share code, notes, and snippets.

@obfusk
Last active September 2, 2023 06:43
Star You must be signed in to star a gist
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