LinuxCommandLibrary

ptpython3

Run interactive Python 3 interpreter with enhancements

TLDR

View documentation for the original command

$ tldr ptpython
copy

SYNOPSIS

ptpython3 [options] [file]

PARAMETERS

--vi
    Enable Vi key bindings (default: Emacs).

--emacs
    Enable Emacs key bindings (default).

--config-dir
    Specify the configuration directory.

--version
    Show program's version number and exit

-h, --help
    Show help message and exit

[file]
    Run the file as a script after the interpreter is started.

DESCRIPTION

ptpython3 is an advanced Python REPL (Read-Eval-Print Loop) built on top of the prompt_toolkit library. It offers several features that enhance the interactive Python coding experience, including syntax highlighting, autocompletion, multi-line editing, VI/Emacs key bindings, and integrated documentation. It is designed to improve the efficiency and enjoyment of interactive Python development by providing a more powerful and user-friendly environment than the standard Python interpreter.

It can automatically display docstrings or source code when pressing Ctrl+D (or F2). It also can browse the history of previously entered commands. ptpython provides a more robust and feature-rich environment for both beginners and experienced Python developers who frequently use the interactive interpreter for testing, debugging, or exploring Python code.

KEY BINDINGS

ptpython3 supports both Vi and Emacs key bindings. The default is Emacs, but you can switch to Vi mode using the --vi option. It also supports custom key bindings which can be configured in the config file

CONFIGURATION

The configuration file can be used to customize the appearance and behavior of ptpython3, including themes, key bindings, and other settings. The --config-dir flag can be used to specify the configuration directory.

HISTORY

ptpython is built on top of prompt_toolkit which provides advanced interactive shell functionality. ptpython offers many features to make the REPL experience better, while standard python and ipython are the foundation, ptpython is a good next step for more enhanced coding experience.

SEE ALSO

python3(1), ipython(1)

Copied to clipboard