How to write a list of list into excel using python 3?
new_list = [["first",second"],["third',four"]]
with open("file_name.csv", 'w') as f:
fc = csv.writer(f, lineterminator='\n')
fc.writerows(new_list)
Now i write this list into csv file but i want to write in excel file how?
You try this code:
I think you should use pandas library to write and read data in this library the function pandas.DataFrame.to_excel(..) will make you able to directly write to excel files for all this you may need to define pandas.DataFrame for this work here is a tutorial on pandas-dataframe by dataCamp.
Here is one way to do it using XlsxWriter:
Output: