git404hub

what is python-prompt-toolkit fr?

prompt-toolkit/python-prompt-toolkit — explained in plain English

Analysis updated 2026-06-24

10,447PythonAudience · developerComplexity · 2/5Setup · easy

tl;dr

A Python library for building interactive terminal programs with autocomplete, syntax highlighting, history search, and mouse support, like building a mini shell in Python.

vibe map

mindmap
  root((repo))
    What it does
      Interactive terminal input
      readline replacement
      Rich typing experience
    Features
      Syntax highlighting
      Autocomplete
      Multi-line editing
      Mouse support
    Platforms
      Linux and macOS
      Windows
      FreeBSD
    Audience
      Python developers
      CLI tool builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Add autocomplete and syntax highlighting to a custom Python CLI tool or REPL as the user types.

VIBE 2

Build an interactive terminal shell in Python with command history, Vi or Emacs key bindings, and search.

VIBE 3

Create a multi-line text editor inside a terminal application with mouse support and Unicode handling.

what's the stack?

PythonPygments

how it stacks up fr

prompt-toolkit/python-prompt-toolkitfacebookresearch/xformersmegvii-basedetection/yolox
Stars10,44710,45610,457
LanguagePythonPythonPython
Setup difficultyeasyhardmoderate
Complexity2/54/53/5
Audiencedeveloperresearcherresearcher

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · easy time til it works · 5min

in plain english

python-prompt-toolkit is a Python library for building interactive command-line programs, meaning programs that run in a terminal and let users type input in a rich, responsive way. If you have ever used a terminal shell that shows syntax coloring as you type, offers autocomplete suggestions, or lets you scroll through history, those features are the kind of thing this library makes possible in your own Python program. The library is described as a potential replacement for GNU readline, which is the longstanding Unix tool that adds line-editing capabilities (like pressing the up arrow to recall the previous command) to terminal programs. prompt_toolkit can do everything readline does, and more. Features listed in the README include: syntax highlighting as the user types, multi-line input editing, code completion, both Emacs and Vi keyboard shortcuts, search through input history, mouse support, auto-suggestions similar to the fish shell, and support for Unicode characters including double-width Chinese text. Installation is a single pip command. The library works on Linux, macOS, FreeBSD, OpenBSD, and Windows. The README notes that Windows support is best on recent Windows 10 where the terminal understands standard escape codes, with a fallback for older Windows versions. The simplest usage is just a few lines: import the prompt function, call it with a message string, and it returns whatever the user typed. More complex uses involve customizing the completion logic, adding syntax highlighting, or building a full interactive shell. The repository ships an examples directory with small programs that each demonstrate one feature. ptpython, an interactive Python shell, is listed as a real-world application built on top of this library. The library has only two external dependencies (Pygments for syntax highlighting and wcwidth for character width calculations), keeping it lightweight relative to what it provides.

prompts (copy fr)

prompt 1
Using python-prompt-toolkit, help me build a Python CLI tool that autocompletes commands from a list I define and highlights keywords as the user types.
prompt 2
Show me how to use python-prompt-toolkit to create a multi-line input editor in my Python app that supports Ctrl+R history search and Vi key bindings.
prompt 3
I want to add a custom prompt to my Python script using prompt_toolkit that accepts both single and multi-line input with syntax coloring. Walk me through it.
prompt 4
Help me build an interactive Python shell similar to ptpython using python-prompt-toolkit with tab completion and persistent input history.

Frequently asked questions

what is python-prompt-toolkit fr?

A Python library for building interactive terminal programs with autocomplete, syntax highlighting, history search, and mouse support, like building a mini shell in Python.

What language is python-prompt-toolkit written in?

Mainly Python. The stack also includes Python, Pygments.

How hard is python-prompt-toolkit to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is python-prompt-toolkit for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.