Skip to content

Mic92/pry.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pry.py - an interactive drop in REPL for python

EXAMPLE

Allow to embed ipython/bpython or the builtin python shell in your projects

Example

INSTALL

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

FEATURES

  • 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/down
    • where: Show a backtrace of the current breakpoint
    • removepry: Remove current breakpoint from file
    • showsource: show python source of object
    • editfile: open editor at current breakpoint
    • ls: show properties/methods/local variables, can be also called on objects

USAGE

import pry; pry()

Spawn a REPL when exceptions are thrown:

import pry
def faulty():
    raise Exception("foo")
with pry:
    faulty()

About

pry.py - an interactive drop in shell for python, similar to binding.pry in ruby

Resources

License

Stars

Watchers

Forks

Packages

No packages published