2018年5月25日 星期五

[Python] Export to CSV File


    myFile = open('example3.csv', 'w', newline='')
    with myFile:
        writer = csv.writer(myFile)
        writer.writerows(listDBItem)

    for row in listDBItem:
        myFile = open('example2.csv', 'a', newline='')
        with myFile:
            writer = csv.writer(myFile)
            writer.writerow(row)

沒有留言:

張貼留言