def write_file(filename, filecontent):
    """Write `filecontent` to `filename`.

    :param str filename:
        Absolute pathname of the file.
    :param str filecontent:
        Data to write to `filename`.

    """
    file_ = None
    try:
        file_ = open(filename, 'w')
        file_.write(filecontent)
        file_.close()
    except IOError:
        print('Error creating and writing content to {}'.format(filename))
        exit(1)
