bpython is a beautiful and functional interface to the standard Python interpreter for * nix. It is distributed under the
MIT License and has the following interesting features:
- In-line syntax highlighting
- Auto-complete code with sentences
- Code auto alignment
- Pastebin
- Saving the entered code to a file
- Recover deleted row ("rewind")
- Parameter suggestion for functions
')
Unlike
iPython , which itself implements the functions of the shell, adds improvements and emulates a standard Python
shell ,
bpython simply expands its capabilities with additional modules.
For in-line highlighting,
Pygments is used, which allows you to color the code at the very moment you type it. As in the vast majority of modern IDEs,
bpython displays a list of parameters for any of the functions you call. It first looks at the module, and if it doesn’t find a suitable function, it accesses
pydoc . Code
auto-completion uses the interface to
libreadline . The most unusual feature is the
“rewind” function. The idea is that the code you enter is stored in memory, and when you call
Rewind, the last line is deleted, and the code is updated. Clicking
“Rewind” twice will delete two lines. This is very useful when defining functions and classes. Another extremely useful thing is
Pastebin . By pressing just one button, you get a link to your code, ready for publication on the Internet. This is done using the
bpaste.net service, which, as the name suggests, is designed specifically for
bpython . Also, you can independently change, for example, hotkeys or the color gamut of the backlight to the most suitable ones by slightly tweaking the standard
configuration file .
Installation
Bpython, as you already understood, requires Pygments.- The latest version is currently 0.9.6.2. You can download the package yourself from here . Past releases are available here .
- You can use easy_install :
easy_install bpython
- Or Mercurial :
hg clone bitbucket.org/bobf/bpython
- And finally, the bpython package is included in many repositories, I think it will be easy to find it in them
Django
In order for bpython to work with Django, you have to work a little :)- Add the following code to your ~ / .bashrc ( .profile or .bash_profile ):
export PYTHONSTARTUP = ~ / .pythonrc
- You will also need to change ~ / .pythonrc , add to it:
<br/> try :<br/> from django.core.management import setup_environ<br/> import settings<br/> setup_environ(settings)<br/> except :<br/> pass <br/> <br/>
This way bpython will gain access to the Django environment.useful links
Official site of the projectDocumentationScreenshotsGoogle groupIRC: irc.freenode.net - #bpython