Writing to an Excel spreadsheet

后端 未结 12 2063
不知归路
不知归路 2020-11-22 04:39

I am new to Python. I need to write some data from my program to a spreadsheet. I\'ve searched online and there seem to be many packages available (xlwt, XlsXcessive, openpy

12条回答
  •  猫巷女王i
    2020-11-22 05:25

    CSV stands for comma separated values. CSV is like a text file and can be created simply by adding the .CSV extension

    for example write this code:

    f = open('example.csv','w')
    f.write("display,variable x")
    f.close()
    

    you can open this file with excel.

提交回复
热议问题