[Python] How to write a list of list into excel using python?

Discussão em 'Python' iniciado por Stack, Fevereiro 15, 2025.

  1. Stack

    Stack Membro Participativo

    How to write a list of list into excel using python 3?

    new_list = [["first", "second"], ["third", "fourth"]]
    with open("file_name.csv", 'w') as f:
    fc = csv.writer(f, lineterminator='\n')
    fc.writerows(new_list)


    I can write this list into csv file but How canI want to write in excel file?

    Continue reading...

Compartilhe esta Página