# python program to study character frequencies
# 
# Ethan Bolker
# March 2015
# Math 480 hw2

import sys

def createfrequencytable( filename ):
    table = {} 
    for line in open(filename):
        for c in line:
           if c in table.keys():
               table[c] += 1
           else:
               table[c] = 1
    return(table)



# Fake the default implicit main method that tells python
# where to start execution - the right trick for testing inside a module.
# 
if __name__ == '__main__':
   table = createfrequencytable( sys.argv[1] )
   keys = table.keys()
   for char in sorted(table.keys()):
       print(char + ": " + str(table[char]))




