import csv


def count_csv_rows(csvfile):
    """Counts all of the rows in csvfile.
    csvfile is assumed to be already open.
    """
    csvfile.seek(0)
    csvreader = csv.reader(csvfile, delimiter=',')
    count = 0
    for row in csvreader:
        count += 1
    csvfile.seek(0)
    print("row count=", count)
    return count