4 Alternatives to the Standard Interactive Python Shell
The standard shell is ok, but there are four alternatives that offer missing features.

One of the core advantages of Python compared to many other languages is that it comes with an interactive Shell.
This is especially useful for explorative tasks, e.g. exploratory data analysis or debugging. The standard shell is ok, but there are four alternatives that offer missing features. Let’s start!
1. Standard Shell enhanced by rich

Rich is a Python library for rich text and beautiful formatting in the terminal. It can be installed via pip install rich . Instead of using a different shell, you can make your shell execute those two lines within the standard shell:
from rich import pretty, inspect, traceback as tb
pretty.install(); tb.install(show_locals=False)Once you’ve done that, you will be rewarded with colored output 🌈
2. IPython

IPython is the interactive Python Shell is known by most from Jupyter Notebooks. It can be installed via pip install ipython . You start it over the console via ipython .
You will instantly recognize that the prompt changed from >>> to In [1] . Of course, you can customize it:
IPython gives you autocompletion triggered by Tab and colored errors:


IPython has a couple of advantages compared to the traditional console:
- Colorized input and error messages: You have a much easier time seeing when you started a string or a number.
- Autocompletion: It’s not super fancy, but at least you don’t have to type long strings all the time.
- Block history: It’s pretty common that you want to go back to past input and modify/execute it again. For single-line input that’s fine, but if you have a function definition with nested loops the standard shell just shows you each line. IPython in contrast deals with the whole block as one input, meaning you have to press the up-arrow less often. This is a big deal for me.
- IPython commands: You can use
clearto get a clean window.
You can also configure Django to use the IPython shell. Of course, you can also install rich within the IPython shell to get colored output.
3. bpython

bpython is an interactive shell with tons of auto-completion features. It can be installed via pip install bpython and you start it with bpython . The auto-completion is triggered while you’re typing and gives astonishingly useful hints below your cursor in a box. The really crazy part is the function definition help:

Even better, that help adjusts to the size of your terminal:

You can see it best in an action:
To summarize, bpython has one core advantages compared to the default shell and IPython: Auto-completion / help text. This is a killer feature for me. It also has customization options and you can use bpython with Django.
However, there are also downsides:
- Speed: It feels like there is a tiny delay when I type. It’s only a fraction of a second, but noticeable. I hate it.
- Windows: Due to the usage of the curses library, I expect windows users to have issues using it. It seems to be possible, but bpython is not officially supported.
- Missing Block history: This is an open issue since 2014.
4. PtPython

This looks pretty similar to bpython in the kind of features that are supported, but ptpython obviously uses a different color theme. In contrast to bpython, it supports block-history.
I don’t like the color theme, but you can change it by pressing “F2”. Sadly, something seems not to work as expected. They offer solarized dark, but it doesn’t look like solarized dark 😢
Summary
You can import rich in any interactive shell. For this reason, I didn’t include it in the following summary.

I like bpython best, but the missing block history (issue 22) is a deal-breaker for me. ptpython is the next best option, but I hate the theme. Hence I use IPython pretty often.
I love writing about software development and technology 🤩 Don’t miss updates: Get my free email newsletter 📧 or sign up for Medium ✍️ if you haven’t done it yet — both encourage me to write more 🤗
More content at plainenglish.io. Sign up for our free weekly newsletter. Get exclusive access to writing opportunities and advice in our community Discord.





