Skip to main content

UNKNOWN

Project description

(WORK IN PROGRESS)

Library for building interactive command lines in Python.

It could be a replacement for readline, but it’s more powerful:

  • Syntax highlighting of the input while typing. (Usually with a Pygments lexer.)

  • Multiline input.

  • Advanced code completion.

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()

Architecture

command_prompt
terminal_input

pure_readline
xedit

xline # Extended pure python readline alternative

tprompt, tpython

xline.Line:

    - InputStream
    - InputStreamHandler
    - LineObject
    - Prompt
    - RenderContext
    - Renderer

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

prompt_toolkit-0.1.tar.gz (17.8 kB view details)

Uploaded Source

File details

Details for the file prompt_toolkit-0.1.tar.gz.

File metadata

File hashes

Hashes for prompt_toolkit-0.1.tar.gz
Algorithm Hash digest
SHA256 2162fe9646f397f4b4553a57c760054e36b43cde4bd7d67b7164fa6511fa781f
MD5 dea19326a6645e8b77c864477ea2adf8
BLAKE2b-256 e3374f97706e0121ab50fa92ff571724ea66bc12fa13da064bca7b2dc82b8c5b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page