File Manipulation With Python Grading Guide
File Manipulation With Python Grading Guide
Reading in text 10 to >8 pts 8 to >6 pts 6 to >0 pts 0 pts 10 pts
file and
program Advanced Proficient Developing Not Present
parameters are
correctly read Handles scenarios such as file File is read in File read with errors File not read
not found, incorrect parameter correctly without or filename hard
count, etc., error using the coded in Python
correct parameters. source
Searching for 10 to >8 pts 8 to >6 pts 6 to >0 pts 0 pts 10 pts
text in text file
Advanced Proficient Developing Not Present
Handles the text not found Does not handle Text specified as Text search
scenario silently. Reports no-match scenarios parameter is not not
number of instances found. silently, does not correctly searched for attempted
count number of in the text file read
occurrences but
otherwise searches
correctly
Replacing the 10 to >8 pts 8 to >6 pts 6 to >0 pts 0 pts 10 pts
text searched
for with new Advanced Proficient Developing Not Present
text supplied
as a parameter Correctly modifies the text Text is modified Viable effort is made Text
without inserting extraneous correctly. in changing the text replacement
characters and preserving but extraneous not
case. Reports the line number characters are attempted
where a change is made in the inserted, matches
original file. missed, case not
preserved, etc.,
Modified text 5 to >4 pts 4 to >3 pts 3 to >0 pts 0 pts 5 pts
file is written
out to the file Advanced Proficient Developing Not Present
system.
Modified file correctly written. Modified file is File is not correctly File write
Original file is saved to a file correctly written to written to the file not
with the same name with a file system. system. attempted.
“.bak” extension added.
Total Points: 40