@@ -0,0 +1,1332 @@
+import sys%0A%0Adef query_yes_no_quit(question, default=%22yes%22):%0A    %22%22%22Ask a yes/no/quit question via raw_input() and return their answer.%0A%0A    %22question%22 is a string that is presented to the user.%0A    %22default%22 is the presumed answer if the user just hits %3CEnter%3E.%0A        It must be %22yes%22 (the default), %22no%22, %22quit%22 or None (meaning%0A        an answer is required of the user).%0A%0A    The %22answer%22 return value is one of %22yes%22, %22no%22 or %22quit%22.%0A    %22%22%22%0A    valid = %7B%22yes%22:%22yes%22,   %22y%22:%22yes%22,    %22ye%22:%22yes%22,%0A             %22no%22:%22no%22,     %22n%22:%22no%22,%0A             %22quit%22:%22quit%22, %22qui%22:%22quit%22, %22qu%22:%22quit%22, %22q%22:%22quit%22%7D%0A    if default == None:%0A        prompt = %22 %5By/n/q%5D : %22%0A    elif default == %22yes%22:%0A        prompt = %22 %5BY/n/q%5D : %22%0A    elif default == %22no%22:%0A        prompt = %22 %5By/N/q%5D : %22%0A    elif default == %22quit%22:%0A        prompt = %22 %5By/n/Q%5D : %22%0A    else:%0A        raise ValueError(%22invalid default answer: '%25s'%22 %25 default)%0A%0A    while 1:%0A        sys.stdout.write(question + prompt)%0A        choice = raw_input().lower()%0A        if default is not None and choice == '':%0A            return default%0A        elif choice in valid.keys():%0A            return valid%5Bchoice%5D%0A        else:%0A            sys.stdout.write(%22Please respond with 'yes', 'no' or 'quit'.%5Cn%22)%0A%0Aif __name__ == '__main__':%0A    print query_yes_no_quit(%22Do you like OCNI ;-) ?%22, %22no%22)

add ask_user_details file