Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (18 sloc) 466 Bytes
from prompt_toolkit import PromptSession
def show_help():
print("""Help
--------
quit - quit this application
exit - exit from this application
eval - evaluate
""")
s = PromptSession()
while True:
cmd = s.prompt("Command: ", multiline=True)
print("Entered text: {}".format(cmd))
if cmd in {"q", "quit", "Quit", "exit", "Exit"}:
break
elif cmd in {"help", "Help", "?"}:
show_help()
elif cmd == "eval":
print("42")