Python is a very useful and popular interpretive programming language, one of the advantages of which is the ability to use its interactive shell for exploratory programming. You can try typing in some code and get feedback from the interpreter immediately without having to write a script specifically. But Python's own shell has some limitations, such as the inability to auto-complete, the inability to highlight syntax, and so on.
Fortunately, the powerful Python extended the default shell and developed many beautiful python shells. Each one provides an excellent interactive Python experience. Today I would like to introduce one of the more excellent-bpython.
Bpython Introduction
Bpython is a nice Python interpreter interface, the developer's goal is to provide users with all the built-in features, much like the current IDE (integrated development environment), but these features are encapsulated in a simple, lightweight package, can be run in a terminal window.
Bpython does not seek to create anything new or groundbreaking. Instead, it gathers a few simple ideas that focus on practicality and operability.
How to Install
The latest version of Bpython is 0.15. There are four types of mounting options:
- Download the latest version of tarball:http://bpython-interpreter.org/releases/
- Clone Bpython git repository: Git clone https://github.com/bpython/bpython/
- Install via PIP: Pip install Bpython
- Package Manager via system: Apt-get install Bpython
If you want Bpython to work properly, you will also need to install the following dependency packages:
Pygments requests Curtsies >= 0.1.18,< 0.2 greenlet urwid (for Bpython-urwid only)
Specific functions
Features are very rich, including:
- Built-in syntax highlighting – use Pygments to lay out the code you've knocked out and make a reasonable color match
- Show auto-complete suggestions based on your behavior
- List the desired parameters for any Python function – you can display a list of parameters for any function you call
- The "Rewind" function will bring up the last line of code in memory and execute it again.
- You can send the code you entered to Pastebin
- You can save the code you entered to a file
- Auto Indent
- Support for Python 3
A similar Python shell
In addition to Bpython, there are three similar python shells such as Ipython, Ptpython, and Dreampie.
Know what is Bpython, its installation method, the function of it, I hope you can in-depth understanding.