def write_list_to_file(filename, input_list):
    """Write a list to a text file with each element on a new line

    Parameters
    ----------
    filename : str
        the filename that the list will be saved to

    input_list : list
        list to save

    Examples
    --------
    Find all images ending in ".jpg" in "./images" folder
    
    .. code-block:: python

        import cloudburst as cb

        some_numbers = [i for i in range(50)]
        cb.write_list_to_file("numbers.txt", some_numbers)
    """
    with open(filename, 'w') as f:
        for item in input_list:
            f.write('{}\n'.format(item))
