Skip to main content

A simple python class for creating Read Evaluate Print Line (REPL) interfaces

Project description

Easy REPL

A simple python class for creating Read Evaluate Print Line (REPL) interfaces.

Requirements

This module requires Python 3.7 or higher.

Additionally this library uses the termios module so it will only work on Unix based systems.

Usage

This module exposes the REPL class which can be used to quickly create a REPL interface. REPL will read in a line of user input via a custom input function that allows you to edit the text by moving the cursor with the arrow keys, as well as view the history of previous inputs.

from easyrepl import REPL

for line in REPL():
    # do something with line
    print(line)

which will create a simple echoing REPL interface that repeats any line you type into it (Ctrl-D to exit).

>>> hello
hello
>>> world
world
>>>

Additionally the standalone readl function is available. It provides the simple line editor interface for reading in a line of text from the terminal. I.e. you can use the arrow keys to move the cursor and edit the line.

from easyrepl import readl

line = readl()

Project details


Download files

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

Source Distribution

easyrepl-0.0.3.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

easyrepl-0.0.3-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file easyrepl-0.0.3.tar.gz.

File metadata

  • Download URL: easyrepl-0.0.3.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for easyrepl-0.0.3.tar.gz
Algorithm Hash digest
SHA256 e30683cf49878ffcd54a5b8c143109b45c67330b62b483f6650c45f086c373a1
MD5 4568abc7f420ed1a5942da76f6d8a382
BLAKE2b-256 07a8d72431dd85a94d11aca7a57a429c3e2bea6db1ccf25f655693cc315e30c5

See more details on using hashes here.

File details

Details for the file easyrepl-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: easyrepl-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for easyrepl-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e8cc6c81e817b27f6623eda39629cd202bde7c9c41bd92278d21fd85466d346f
MD5 22da60fc0807558ad14a26d467980177
BLAKE2b-256 2746382024b15652bead8ff908e4006bf9f42a4fbdcd8f900de50551d2f4252e

See more details on using hashes here.

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