Now I would like to output to XLS workbook using 'xlwt' instead.
I would also like to keep the original headers
["MACADDRESS", "IPADDRESS", "INTERFACE","ENCAP", "TENANT", "APP PROFILE", "EPG"]
is this better?
I would also like to keep the original headers
["MACADDRESS", "IPADDRESS", "INTERFACE","ENCAP", "TENANT", "APP PROFILE", "EPG"]
import xlwt wb = xlwt.Workbook() ws = wb.add_sheet('EndPoints') ws.write(--==Just working on this bit==--) wb.save('ACI-Endpoints.xls')
(Jan-27-2018, 05:49 PM)j.crater Wrote: Thanks for posting your solution. I recommend you to alter the part of code you use to open and write to file. See here how context managers (with) are usually used with files.
is this better?
# Write downloaded data to ACI-Endpoints.csv myFile = open('ACI-Endpoints.csv', 'w') with myFile as f: writer = csv.writer(myFile) writer.writerows(data) f.closed