Allow to embed ipython/bpython or the builtin python shell in your projects
pip install pry.py
or
$ curl https://raw.githubusercontent.com/Mic92/pry.py/master/pry.py > pry.py
or:
pip install git+https://github.com/Mic92/pry.py
- works with python2.7/python3
- optional syntax highlighting (requires pygments)
- auto completion
- In IPython also the following magics (commands) are defined:
up/down
: Navigate in the call stack up/downwhere
: Show a backtrace of the current breakpointremovepry
: Remove current breakpoint from fileshowsource
: show python source of objecteditfile
: open editor at current breakpointls
: show properties/methods/local variables, can be also called on objects
import pry; pry()
Spawn a REPL when exceptions are thrown:
import pry
def faulty():
raise Exception("foo")
with pry:
faulty()