This article describes how Python exports data to a CSV file that Excel can read. Share to everyone for your reference. The implementation methods are as follows:
|1 2 3 4 5 6 7||Import csv with open (' Eggs.csv ', ' WB ') as CSVFile: #spamwriter = Csv.writer (CSVFile, delimiter= ', quotechar= ' | '), #quoting =csv. Quote_minimal) Spamwriter = Csv.writer (csvfile, dialect= ' Excel ') spamwriter.writerow ([' Spam '] * 5 + [' Baked Beans ']) Spam Writer.writerow ([' Spam ', ' lovely Spam ', ' wonderful Spam '])|
I hope this article will help you with your Python programming.