27 lines
628 B
Python
27 lines
628 B
Python
# deck.input: Standard input abstraction library for max compatibility
|
|||
|
|
# Created by Luxferre in 2025, released into public domain
|
||
|
|
|
||
|
|
# init the tdeck_repl input where applicable
|
||
|
|
try:
|
||
|
|
from tdeck_repl import input
|
||
|
|
except:
|
||
|
|
pass
|
||
|
|
|
||
|
|
input = input # reexport the standard Python input method
|
||
|
|
|
||
|
|
def input_multi(prompt=None, terminator='.'):
|
||
|
|
"""Multiline input method (ed-like)"""
|
||
|
|
buf = []
|
||
|
|
if prompt is not None:
|
||
|
|
print(prompt, end='')
|
||
|
|
while True:
|
||
|
|
try:
|
||
|
|
s = input()
|
||
|
|
if s == terminator: break
|
||
|
|
else: buf.append(s)
|
||
|
|
except (KeyboardInterrupt, EOFError):
|
||
|
|
print()
|
||
|
|
break
|
||
|
|
return '\n'.join(buf)
|
||
|
|
|