Skip to content

Prompt Toolkit

Python Prompt Toolkit is a library for building powerful interactive command line and terminal applications in Python.

Installation

pip install prompt_toolkit

Usage

A simple prompt

The following snippet is the most simple example, it uses the prompt() function to asks the user for input and returns the text. Just like (raw_)input.

from prompt_toolkit import prompt

text = prompt('Give me some input: ')
print('You said: %s' % text)

It can be used to build REPL applications or full screen ones.