File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed
Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -1168,17 +1168,22 @@ Text and files and dicts, and...
11681168Exceptions
11691169-----------
11701170
1171- Improving ``raw_input ``
1172-
1173- * The ``raw_input() `` function can generate two exceptions: ``EOFError `` or
1174- ``KeyboardInterrupt `` on end-of-file(EOF) or canceled input.
1175-
1176- * Create a wrapper function, perhaps ``safe_input() `` that returns ``None ``
1177- rather rather than raising these exceptions, when the user enters ``^C `` for
1178- Keyboard Interrupt, or ``^D `` (``^Z `` on Windows) for End Of File.
1179-
1180- * Use this wrapper to get input from users in your mailroom program and use
1181- exceptions (and EAFP) to handle malformed numeric input
1171+ * Improving raw_input :
1172+ - Create a new file: safe_input.py -- add it to your repo, and submit a pull request. Make sure to make frequent commits with good commit messages.
1173+
1174+ * The raw_input() function can generate two exceptions:
1175+ - EOFError or end-of-file (EOF)
1176+ - KeyboardInterrupt or canceled input.
1177+ - Create a wrapper function, perhaps safe_input() that returns 'None' rather than raising these exceptions.
1178+ * Note:
1179+ - ^C causes a KeyboardInterrupt Error
1180+ - ^D (^Z on Windows) causes an End Of File Error.
1181+ - ^ is the Control character
1182+
1183+ * The next step should be done in your mailroom.py file:
1184+
1185+ - Update your mailroom.py program to use exceptions (and BAFP) to handle malformed numeric input (and other malformed input)
1186+ - Make sure to have your commit comment reflect that you've added this feature
11821187
11831188
11841189Paths and File Processing
You can’t perform that action at this time.
0 commit comments