#!/usr/bin/python '''Prints out a set of lines each with the row number and the name associated with that row''' from openpyxl import load_workbook import argparse argparser = argparse.ArgumentParser(prog='listnames.py') argparser.add_argument('--infile', default='membership.xlsx', help='Input file name') args = argparser.parse_args() wb = load_workbook(filename=args.infile) sheet = wb.worksheets[2] # igore the title row first = True for row in sheet.rows: if row[0].value == "" or row[0].value == None or first: first = False continue print("%d:%s:%s:%s:%s:%s:%s:%s:%s:%s" % (row[0].row, row[0].value, row[1].value, row[2].value, row[3].value, row[4].value, row[5].value, row[6].value, row[7].value, row[8].value))