How to export data to xlsx using xlsxwriter for python -
i having trouble writing data excel files. running code not write file expected folder.
import xlsxwriter workbook = xlsxwriter.workbook('c:\\users\\hburk\\desktop\\python\\sqloutput.xlsx') east = workbook.add_worksheet() eastdata = ( ['apples', 4.0], ['bananas', 5.0], ) row = 1 col = 0 pointname, price in eastdata: east.write_string(row, col, pointname) east.write(row, col+1, price) row += 1 workbook.close()
edits: changed silly errors: eastres , east.close() - tried simplify original code , mucked things up. code still doesn't work written here.
just don't forget close workbook
:
workbook.close()
Comments
Post a Comment