import json


def write_json(file_path, json_obj):
    """Write JSON string.

    # Arguments
        file_path: `str`<br/>
            the absolute path to the JSON string.
        json_obj: `dict`<br/>
            a dictionary

    # Returns
        flag : bool
            True if saved successfully
            False otherwise
    """
    try:
        with open(file_path, "w") as f:
            json.dump(json_obj, f)
            f.close()
        return True
    except IOError:
        return False