Python 和 bpython 有什么区别?

ipython有什么是 bpython所缺乏的,反之亦然? 这两者有什么不同?

29581 次浏览

If you just want an interactive interpreter, bpython should be fine. Just use it until you miss some feature you liked about IPython.

There are lots of features that IPython offers over bpython:

  • Special threading options. I like -gthread for experimenting with PyGTK and -pylab for matplotlib.

  • direct invocation of shell commands. cd in IPython is quite useful.

  • Full readline library support -- I can use the keyboard shortcuts I am used to.

  • Module reload facility - You can do a deep reload of a module after you have changed your code. This is very useful for testing and debugging.

  • Run functions in the background in a separate task with %bg.

  • A whole parallel programming environment (not really a feature you expect from an interactive Python shell, but IPython offers it).

This list could be nearly arbitrarily continued. And of course there will be lots of features in bpython lacking from IPython, but you did not ask for those.

So just use the one that works for you!

IPython Notebook (since 0.12) is a killer feature.