Jan-27-2018, 08:46 PM
(This post was last modified: Jan-27-2018, 09:57 PM by Gribouillis.)
(Jan-27-2018, 07:56 PM)haziebaby Wrote: If there is a better way please commentIf the Excel file doesn't need special formatting, you can write a csv and convert to xls by running an external command from python, for example if you have libreoffice installed on your computer, the following should work:
returncode = subprocess.call("soffice --headless --convert-to xls ACI-Endpoints.csv") if returncode: raise RuntimeError(('Conversion to xls failed for', 'ACI-Endpoints.csv'))You can also convert to xlsx with
soffice --headless --convert-to xlsx:"Calc MS Excel 2007 XML" file.csv