Skip to content

Instantly share code, notes, and snippets.

@soon
Created August 27, 2014 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soon/91116ff1a0042a3d131b to your computer and use it in GitHub Desktop.
Save soon/91116ff1a0042a3d131b to your computer and use it in GitHub Desktop.
import os
with open('original', 'r') as o:
original = set(o.readlines())
with open('report.txt', 'w') as report:
for subdir, _, files in os.walk('submissions_462'):
for f in files:
with open(os.path.join(subdir, f), 'r') as file:
s = set(file.readlines())
report.write('{}: {}\n'.format(f, len(original & s)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment