📜 ⬆️ ⬇️

bpython

image 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:





')
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.



Django

In order for bpython to work with Django, you have to work a little :)

  1. Add the following code to your ~ / .bashrc ( .profile or .bash_profile ):
    export PYTHONSTARTUP = ~ / .pythonrc


  2. 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 project
Documentation
Screenshots
Google group
IRC: irc.freenode.net - #bpython

Source: https://habr.com/ru/post/81158/


All Articles