Skip to content

Instantly share code, notes, and snippets.

@vkolev
Created January 26, 2021 10:11
Show Gist options
  • Save vkolev/7647189cf5bf7ada05efc3ceb8608351 to your computer and use it in GitHub Desktop.
Save vkolev/7647189cf5bf7ada05efc3ceb8608351 to your computer and use it in GitHub Desktop.
import nimpy
proc yes(question: string): bool {.exportpy.} =
echo question, "(y/n)"
while true:
case readLine(stdin)
of "y", "Y", "yes", "Yes": return true
of "n", "N", "no", "No": return false
else: echo "Please be clear yes or no"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment