Coding

ptpython – advanced interactive Python REPL

ptpython is an advanced interactive Python shell built using the prompt_toolkit library. It provides a more sophisticated environment than the standard Python interpreter, with features designed to make entering, editing and executing Python code easier.

Its interface combines intelligent completion, syntax-aware editing and configurable keyboard controls. Users can work with multiline expressions, inspect suggestions as they type and navigate previously entered commands without leaving the terminal.

ptpython is particularly useful for developers who regularly experiment with Python code or need an interactive environment while working remotely. It can also be embedded into other Python applications, providing an interactive debugging and exploration interface.

The project includes ptipython, which combines the ptpython interface with IPython’s additional interactive computing capabilities.

This is free and open source software.

Key Features

  • Syntax highlighting with configurable colour schemes.
  • Multiline editing with automatic indentation and convenient navigation between lines.
  • Intelligent autocompletion for Python objects, functions and filenames.
  • Syntax validation before execution, with errors highlighted in the input.
  • Both Vi and Emacs keyboard bindings.
  • Optional mouse support for navigating the interface.
  • Bracketed paste support that preserves indentation when inserting code.
  • Interactive configuration menu for changing editing and display preferences.
  • Persistent command history and dedicated history browsing interface.
  • Execute operating system commands without leaving the interactive shell.
  • Support for top-level await expressions through an asyncio event loop.
  • Custom formatting of objects using the __pt_repr__ method.
  • Embedding of the interactive interpreter in existing Python applications.
  • IPython integration through ptipython and support for Django shell environments.
  • Support for double-width Unicode characters.
  • Cross-platform support – runs on Linux, macOS, and Windows.

Website: github.com/prompt-toolkit/ptpython
Support:
Developer: Jonathan Slenders
License: BSD 3-Clause ‘New’ or ‘Revised’ License

ptpython

ptpython is written in Python. Learn Python with our recommended free books and free tutorials.


Related Software

Open Source Python Shells
IPythonEnhanced interactive Python shell
ptpythonAdvanced Python Read-Eval-Print Loop
bpythonFancy interface to the Python interpreter
IDLEIntegrated development environment for Python
Jupyter QtConsoleGraphical console for working interactively with Jupyter kernels
mypythonInteractive Python shell with syntax highlighting and completion
DreamPiePython shell which is designed to be reliable and fun

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted