def save_csv(p, sheet):
    'Save as single CSV file, handling column names as first line.'
    with p.open_text(mode='w') as fp:
        cw = csv.writer(fp, **csvoptions())
        colnames = [col.name for col in sheet.visibleCols]
        if ''.join(colnames):
            cw.writerow(colnames)
        for r in Progress(sheet.rows, 'saving'):
            cw.writerow([col.getDisplayValue(r) for col in sheet.visibleCols])
def save_csv ( p , sheet ) : with p . open_text ( mode = 'w' ) as fp : cw = csv . writer ( fp , ** csvoptions ( ) ) colnames = [ col . name for col in sheet . visibleCols ] if '' . join ( colnames ) : cw . writerow ( colnames ) for r in Progress ( sheet . rows , 'saving' ) : cw . writerow ( [ col . getDisplayValue ( r ) for col in sheet . visibleCols ] )
Save as single CSV file, handling column names as first line.