def promptyn(msg, default=None):
while True:<EOL><INDENT>yes = "<STR_LIT:Y>" if default else "<STR_LIT:y>"<EOL>if default or default is None:<EOL><INDENT>no = "<STR_LIT:n>"<EOL><DEDENT>else:<EOL><INDENT>no = "<STR_LIT:N>"<EOL><DEDENT>confirm = prompt("<STR_LIT>" % (msg, yes, no), "<STR_LIT>").lower()<EOL>if confirm in ("<STR_LIT:y>", "<STR_LIT:yes>"):<EOL><INDENT>return True<EOL><DEDENT>elif confirm in ("<STR_LIT:n>", "<STR_LIT>"):<EOL><INDENT>return False<EOL><DEDENT>elif not confirm and default is not None:<EOL><INDENT>return default<EOL><DEDENT><DEDENT>
Display a blocking prompt until the user confirms