I am using Python 2.6 and I want to write in a csv file. This is my code.
fieldnames = ['Date', 'AICENT MO', 'AICENT MT', 'BELGACOM MO', 'BELGACOM MT', 'CITIC MO', 'CITIC MT', 'SYBASE MO','SYBASE MT']
csvfile = open('%s%s_%s.csv'%(report,module_name,lastMonth), 'w')
writer = csv.writer(csvfile, dialect='excel')
writer.writerow(fieldnames)
list = [date_file,col1,col2,col3,col4,col5,col6,col7,col8]
writer.writerow(list)
My Output is:
How to remove those empty rows?