Learning Scientific Programming with Python (2nd edition)
P4.4.4: Batch renaming of files
Question P4.4.4
Modify the program of Example E4.16 to catch the following errors and handle them gracefully:
- The user does not provide a directory name on the command line (issue a usage message);
- The directory does not exist;
- The name of a file in the directory does not have the correct format;
- The filename is in the correct format but the month abbreviation is not recognised.
Your program should terminate in the first two cases and skip the file in the second two.