LinuxCommandLibrary

bpython

Interactive Python interpreter with autocompletion

TLDR

Start a REPL (interactive shell)

$ bpython
copy

Execute a specific Python file
$ bpython [path/to/file.py]
copy

Execute a specific Python file and start a REPL
$ bpython [[-i|--interactive]] [path/to/file.py]
copy

Use the specified config file instead of the default config
$ bpython --config [path/to/file.conf]
copy

SYNOPSIS

bpython [options] [file] [args...]

PARAMETERS

-h, --help
    Show help message and exit.

-V, --version
    Show version number and exit.

-i, --interactive
    After running file, drop into bpython shell instead of exiting.

-q, --quiet
    Be more quiet during startup.

--config
    Use as config file instead of default.

-l , --logfile
    Log to instead of stdout.

-n , --namespace
    Read initial namespace from instead of __main__.


    File to execute. If omitted, starts an interactive session.

[args...]
    Arguments passed to the file being executed, accessible via sys.argv.

DESCRIPTION

bpython is a fancy terminal interface to the Python interactive interpreter. It features syntax highlighting, expected parameter list, auto-completion and recall. It aims to be lightweight, useful and fun.

It features inline syntax highlighting, similar to what you'd expect in modern IDEs. As you type, bpython highlights syntax errors and provides suggestions for auto-completion. It also provides a 'rewind' function, letting you pop the last line off the buffer and re-execute it. This is invaluable for correcting typos or re-running slightly modified commands.

bpython offers a convenient way to explore Python code, experiment with new libraries, and debug your scripts. It enhances the standard Python interpreter experience significantly.

CONFIGURATION

bpython is configurable via a configuration file, typically located at ~/.config/bpython/config. This file allows you to customize aspects such as syntax highlighting colors, keybindings, and other preferences.

The configuration file uses a simple INI-style format. See the bpython documentation for available options.

SEE ALSO

python(1)

Copied to clipboard