Anonymous user
Readline interface: Difference between revisions
Add a demonstration of python's readline capabilities
SqrtNegInf (talk | contribs) m (→{{header|Raku}}: Fix comments: Perl 6 --> Raku) |
(Add a demonstration of python's readline capabilities) |
||
Line 898:
> save
> 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}}==
|