Skip to main content

UNKNOWN

Project description

(WORK IN PROGRESS)

prompt_toolkit is a Library for building interactive command lines in Python.

It could be a replacement for readline. It’s Pure Python, and has some advanced features:

  • Syntax highlighting of the input while typing. (Usually with a Pygments lexer.)
  • Multiline input
  • Advanced code completion
  • Both Emacs and Vi keybindings (Similar to readline), including reverse and forward incremental search

The Python repl

Run ./bin/prompt-toolkit-python-repl to get an interactive Python prompt with syntaxt highlighting, code completion, etc…

Example

from prompt_toolkit import CommandLine
from prompt_toolkit.line import Exit

def main():
    # Create CommandLine instance
    cli = CommandLine()

    try:
        while True:
            code_obj = cli.read_input()
            print('You said: ' + code_obj.text)

    except Exit: # Quit on Ctrl-D keypress
        return

if __name__ == '__main__':
    main()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
prompt_toolkit-0.2.tar.gz (25.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page