Define the function with:
def(character, filepath)

Load its content in a string and then use the str.count(character) method.