Skip to content

Instantly share code, notes, and snippets.

@paultopia
Last active May 19, 2016 22:38
Show Gist options
  • Select an option

  • Save paultopia/0ebe31ec0ec06e9022831e5f3be16d4d to your computer and use it in GitHub Desktop.

Select an option

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.
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