Last active
May 19, 2016 22:38
-
-
Save paultopia/0ebe31ec0ec06e9022831e5f3be16d4d to your computer and use it in GitHub Desktop.
for future personal reference: just compare filenames to grade CSV to make sure no grades are missed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv, glob | |
| examfiles = [x[0:4] for x in glob.glob("*.pdf")] | |
| with open("count.csv", 'rU') as grades: | |
| gradelist = [x[0] for x in csv.reader(grades, dialect=csv.excel_tab)] | |
| # but csv is shit so: | |
| grades = [x[0:4] for x in gradelist] | |
| missinggrades = [] | |
| for i in examfiles: | |
| if i not in grades: | |
| missinggrades.append(i) | |
| wronggrades = [] | |
| for i in grades: | |
| if i not in examfiles: | |
| wronggrades.append(i) | |
| print "exams without grades: " + ", ".join(missinggrades) | |
| print "grades without exams: " + ", ".join(wronggrades) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment