()
| 26 | |
| 27 | |
| 28 | def b_modify(): |
| 29 | # Deleting the Roll no. entered by user |
| 30 | if not os.path.exists(student_record): |
| 31 | logging.warning("File not found") |
| 32 | return |
| 33 | roll_no = int(input("Enter the Roll No. to be deleted: ")) |
| 34 | student = 0 |
| 35 | with open(student_record, "rb") as F: |
| 36 | student = pickle.load(F) |
| 37 | |
| 38 | with open(student_record, "wb") as F: |
| 39 | rec = [i for i in student if i[0] != roll_no] |
| 40 | pickle.dump(rec, F) |
| 41 | |
| 42 | |
| 43 | b_read() |