def read_file(filename):
    """ Read a file, and return its contents. """
    program = None
    try:
        with open(filename, 'r') as f:
            program = f.read()
            return program
    except (IOError, OSError) as e:
        print("Unable to read file: {}".format(e))
        return None