Skip to content

Instantly share code, notes, and snippets.



Created Mar 25, 2015
What would you like to do?
import os
import sys
from collections import Counter
if len(sys.argv) < 2:
print('needs at least two arguments, <char set> <files>...')
characters = sys.argv[1]
counter = Counter()
for filename in sys.argv[2:]:
with open(filename) as f:
contents =
for character in characters:
counter[character] += contents.count(character)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment