Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

carocancode/bpython

 
 

Repository files navigation

https://img.shields.io/pypi/v/bpythonhttps://readthedocs.org/projects/bpython/badge/?version=latest

bpython: A fancy interface to the Python interactive interpreter

Introduction:bpython is a lightweight Python interpreter with added features commonly found in integrated development environments (IDEs). These features include syntax highlighting, auto-indentation, autocompletion, and displaying expected parameter lists for functions.

Features:- Autocomplete suggestions as you type (similar to Readline).- In-line syntax highlighting using Pygments.- Display of expected parameter lists for functions.- Rewind function to re-evaluate and edit previous code.- Open current session in an external text editor.- Paste code to pastebin or write to a file.- Reload imported Python modules to test changes.

Usage:bpython is not a full IDE but a practical and lightweight solution. It's ideal for testing code, helping others on IRC, or quick experimentation.

bpython

bpython doesnot aim to be a complete IDE - the focus is on implementing afew ideas in a practical, useful, and lightweight manner.

bpython is a great replacement to any occasion where you would normally use thevanilla 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 - includingfull documentation - at ourhomepage.

Installation & Basic Usage

Installation:Using Pip:If you have pip installed, run: $ pip install bpythonStart bpython by typing bpython in the terminal. Exit with exit() or ctrl-D.

Dependencies:- Pygments- curtsies >= 0.4.0- greenlet- pyxdg- requests- Sphinx >= 1.5 (optional, for documentation)- babel (optional, for internationalization)- jedi (optional, for multiline completion)- watchdog (optional, for monitoring module changes)- pyperclip (optional, for clipboard copying)===================Features & Examples===================* Readline-like autocomplete, with suggestions displayed as you type.

  • In-line syntax highlighting. This uses Pygments for lexing the code as youtype, and colours appropriately.
  • Expected parameter list. As in a lot of modern IDEs, bpython will attempt todisplay a list of parameters for any function you call. The inspect module (whichworks 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 andwhen the Rewind function is called, the last line is popped and the entiresession is re-evaluated. Use <control-R> to rewind.
  • Edit the current line or your entire session in an editor. F7 opens the currentsession in a text editor, and if modifications are made, the session is rerunwith these changes.
  • Pastebin code/write to file. Use the <F8> key to upload the screen's contentsto pastebin, with a URL returned.
  • Reload imported Python modules. Use <F6> to clear sys.modules and rerun yoursession 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 saveyour 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

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 managementsystems. If you use one of these OSes, you can installbpython using thepackage manager.

Ubuntu/Debian

Ubuntu/Debian family Linux users can installbpython using theaptpackage manager, using the command withsudo privileges:

$ apt install bpython

In case you are using an older version, run

$ apt-get install bpython

Arch Linux

Arch Linux usespacman as the default package manager; you can use it to installbpython:

$ pacman -S bpython

Fedora

Fedora users can installbpython directly from the command line usingdnf.

$ dnf install bpython

GNU Guix

Guix users can installbpython 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 anythird-party package manager like MacPorts, you can install it via

$ sudo port install py-bpython

Known Bugs

For known bugs please see bpython'sknown issues and FAQ page.

Contact & Contributing

I hope you find it useful and please feel free to submit any bugs/patchessuggestions toRobert or place them on the GitHubissues tracker.

For any other ways of communicating with bpython users and devs you can find usat the community page on theproject homepage, or in thecommunity.

Hope to see you there!

About

bpython - A fancy curses interface to the Python interactive interpreter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python100.0%

[8]ページ先頭

©2009-2026 Movatter.jp