No project description provided
Project description
bpython: A fancy interface to the Python interactive interpreter
bpython is a lightweight Python interpreter that adds several features common to IDEs. These features include syntax highlighting, expected parameter list, auto-indentation, and autocompletion. (See below for example usage).
bpython does not aim to be a complete IDE - the focus is on implementing a few ideas in a practical, useful, and lightweight manner.
bpython is a great replacement to any occasion where you would normally use the vanilla Python interpreter - testing out solutions to people’s problems on IRC, quickly testing a method of doing something without creating a temporary file, etc.
You can find more about bpython - including full documentation - at our homepage.
Installation & Basic Usage
Installation using Pip
If you have pip installed, you can simply run:
$ pip install bpython
Start bpython by typing bpython in your terminal. You can exit bpython by using the exit() command or by pressing control-D like regular interactive Python.
Features & Examples
Readline-like autocomplete, with suggestions displayed as you type.
In-line syntax highlighting. This uses Pygments for lexing the code as you type, and colours appropriately.
Expected parameter list. As in a lot of modern IDEs, bpython will attempt to display a list of parameters for any function you call. The inspect module (which works with any Python function) is tried first, and then pydoc if that fails.
Rewind. This isn’t called “Undo” because it would be misleading, but “Rewind” is probably as bad. The idea is that the code entered is kept in memory and when the Rewind function is called, the last line is popped and the entire session is re-evaluated. Use <control-R> to rewind.
Edit the current line or your entire session in an editor. F7 opens the current session in a text editor, and if modifications are made, the session is rerun with these changes.
Pastebin code/write to file. Use the <F8> key to upload the screen’s contents to pastebin, with a URL returned.
Reload imported Python modules. Use <F6> to clear sys.modules and rerun your session to test changes to code in a module you’re working on.
Configuration
See the sample-config file for a list of available options. You should save your config file as ~/.config/bpython/config (i.e. $XDG_CONFIG_HOME/bpython/config) or specify at the command line:
bpython --config /path/to/bpython/config
Dependencies
Pygments
curtsies >= 0.4.0
greenlet
pyxdg
requests
Sphinx >= 1.5 (optional, for the documentation)
babel (optional, for internationalization)
jedi (optional, for experimental multiline completion)
watchdog (optional, for monitoring imported modules for changes)
pyperclip (optional, for copying to the clipboard)
bpython-urwid
bpython-urwid requires the following additional packages:
urwid
Installation via OS Package Manager
The majority of desktop computer operating systems come with package management systems. If you use one of these OSes, you can install bpython using the package manager.
Ubuntu/Debian
Ubuntu/Debian family Linux users can install bpython using the apt package manager, using the command with sudo privileges:
$ apt install bpython
In case you are using an older version, run
$ apt-get install bpython
Arch Linux
Arch Linux uses pacman as the default package manager; you can use it to install bpython:
$ pacman -S bpython
Fedora
Fedora users can install bpython directly from the command line using dnf.
$ dnf install bpython
GNU Guix
Guix users can install bpython on any GNU/Linux distribution directly from the command line:
$ guix install bpython
macOS
macOS does not include a package manager by default. If you have installed any third-party package manager like MacPorts, you can install it via
$ sudo port install py-bpython
Known Bugs
For known bugs please see bpython’s known issues and FAQ page.
Contact & Contributing
I hope you find it useful and please feel free to submit any bugs/patches suggestions to Robert or place them on the GitHub issues tracker.
For any other ways of communicating with bpython users and devs you can find us at the community page on the project homepage, or in the community.
Hope to see you there!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bpython-0.24.tar.gz
.
File metadata
- Download URL: bpython-0.24.tar.gz
- Upload date:
- Size: 222.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98736ffd7a8c48fd2bfb53d898a475f4241bde0b672125706af04d9d08fd3dbd |
|
MD5 | bb7a556715be0b974436eb0d920769c0 |
|
BLAKE2b-256 | cf7654e0964e2974becb673baca69417b6c6293e930d4ebcf2a2a68c1fe9704a |
File details
Details for the file bpython-0.24-py3-none-any.whl
.
File metadata
- Download URL: bpython-0.24-py3-none-any.whl
- Upload date:
- Size: 194.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d196ae3d1ce3dcd559a3fb89ed2c468dfbd1504af0d680b906dd65a9c7a32eb |
|
MD5 | 00d3aad5cf1607409dacf99b715794a3 |
|
BLAKE2b-256 | 0cd9b42a98f329a61a1b0c7d335644025773b05837669f775851d7eaece7973d |