Readline interface: Difference between revisions
Content added Content deleted
SqrtNegInf (talk | contribs) m (→{{header|Raku}}: Fix comments: Perl 6 --> Raku) |
(Add a demonstration of python's readline capabilities) |
||
Line 898: | Line 898: | ||
> save |
> save |
||
> quit |
> quit |
||
=={{header|Python}}== |
|||
Python readline interface is enabled by default in the interpreter REPL, and can be enabled in user code simply by importing the readline module |
|||
<lang python>#!/usr/bin/env python3 |
|||
# |
|||
# A simple readline demo that does nothing. |
|||
# Interactive line editing and history active |
|||
# |
|||
import readline |
|||
while True: |
|||
try: |
|||
print(input('> ')) |
|||
except: |
|||
break |
|||
</lang> |
|||
=={{header|Racket}}== |
=={{header|Racket}}== |