Interactive Programming - REPL "read-eval-print loop" execution paradigm

> Code - (Programming|Computer) Language > Interactive programming

1 - About

REPL (an acronym for “read-eval-print loop”) is a execution paradigm implemented in a command line interpreter that:

  • reads what you type (i.e.
  • evaluates it,
  • and prints the result if any.

A REPL console is a synonym for a command line interpreter.


3 - Implementation


  • Prompt the user for some code,
  • When they’ve entered it, execute it in the same process.
while True:
    code = input(">>> ")

it’s much more complex, because it has to deal with:

  • multi-line code,
  • tab completion (using readline for instance),
  • magic commands,
  • and so on.

4 - Library


5 - Documentation / Reference