def write_line(filename, line=""):
    """Helper method to open a file a write a line to it.

    Args:
        filename (str): Path to the file
        line (str, optional): Line to write to the file. Defaults to "".

    Returns:
        bool: True if successfully written else False.
    """
    try:
        with open(filename, "w") as text_file:
            print(line, file=text_file)
        return True
    except Exception as e:
        print(f"Error while writing: {e}")
        return False