def csv2list(filename, column, lower=True, header=True, dedupe=True): #------<<<
    """
    Create a list from a column in a CSV file.

    filename = name of .CSV file
    column = column # (0-based) to be returned as a list
    lower = whether to make the values in the list lowercase
    header = whether .CSV file has a header row as the first line
    dedupe = whether to remove duplicate values

    Returns the list.
    """
    thelist = []
    firstline = True
    for line in open(filename, 'r').readlines():
        if firstline and header:
            firstline = False
            continue # skip over the header line
        listval = line.split(',')[column].strip().lower() if lower else \
            line.split(',')[column].strip()
        thelist.append(listval)

    if dedupe:
        return sorted(list(set(thelist)))
    else:
        return sorted(thelist)