**prompt_toolkit** is a Python library for building powerful interactive command-line and terminal applications. It was created by Jonathan Slenders and is maintained under the prompt-toolkit GitHub organization.
## What it does
It can serve as a very advanced, pure-Python replacement for GNU readline, but it can also be used to build full-screen terminal applications. It's the engine behind tools like **ptpython** (an enhanced Python REPL), **pyvim** (a Vim clone), and **pymux** (a tmux-like multiplexer).
## Key features
- **Syntax highlighting** of input while typing (e.g., via a Pygments lexer)
- **Multi-line input editing**
- **Advanced code completion**
- **Both Emacs and Vi key bindings** (including advanced Vi features like named registers and digraphs)
- **Reverse and forward incremental search**
- **Auto suggestions** (like the fish shell)
- **Mouse support** for cursor positioning and scrolling
- **Text selection for copy/paste** (Emacs and Vi style)
- **Multiple input buffers** and **no global state**
- **Unicode double-width character support** (Chinese input)
- **Cross-platform**: runs on Linux, macOS, FreeBSD, OpenBSD, and Windows
## Technical details
- **Pure Python**, works on Python 3.6+ (prompt_toolkit 3.0)
- **Lightweight** — the only dependencies are Pygments and wcwidth
- **No assumptions about I/O** — applications can run in a telnet/SSH server or an asyncio process
- Licensed under **BSD-3-Clause**
- ~10.6k stars on GitHub
## Simple example
```python
from prompt_toolkit import prompt
if __name__ == '__main__':
answer = prompt('Give me some input: ')
print('You said: %s' % answer)
```
## Installation
```bash
pip install prompt_toolkit
# or with conda
conda install -c conda-forge prompt_toolkit
```
Sources:
- [Official documentation (Python Prompt Toolkit 3.0)](https://python-prompt-toolkit.readthedocs.io/en/master/)
- [GitHub repository](https://github.com/prompt-toolkit/python-prompt-toolkit)
- [prompt_toolkit on PyPI](https://pypi.org/project/prompt_toolkit/)
1searchprompt-toolkit Python library
2navigatehttps://python-prompt-toolkit.readthedocs.io/en/master/
3navigatehttps://github.com/prompt-toolkit/python-prompt-toolkit