File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1515if PY3 :
1616 iteritems = lambda d : iter (d .items ())
1717 def read_response (prompt = '' ):
18+ """
19+ Prompt the user for a response.
20+
21+ Prints the given prompt (which should be a Unicode string),
22+ and returns the text entered by the user as a Unicode string.
23+
24+ :param prompt: A Unicode string that is presented to the user.
25+ """
26+ # The Python 3 input function does exactly what we want
1827 return input (prompt )
1928else :
2029 def read_response (prompt = '' ):
30+ """
31+ Prompt the user for a response.
32+
33+ Prints the given prompt (which should be a Unicode string),
34+ and returns the text entered by the user as a Unicode string.
35+
36+ :param prompt: A Unicode string that is presented to the user.
37+ """
2138 # For Python 2, raw_input takes a byte string argument for the prompt.
2239 # This must be encoded using the encoding used by sys.stdout.
2340 # The result is a byte string encoding using sys.stdin.encoding.
You can’t perform that action at this time.
0 commit comments