读取excel 文件的数据

import csv
with open('D:/mystuff/11.csv','r') as f:
    reader = csv.reader(f)
    for row in reader:
        print(row)
        

写入excel文件

import csv
with open('D:/mystuff/33.csv', mode='w') as csvfile:
    #w1=csv.writer(csvfile,delimiter=' ',quotechar="|",quoting=csv.QUOTE_MINIMAL)
    w1=csv.writer(csvfile,dialect='excel')
    w1.writerow(['1','2','3','4'])
    w1.writerow(['11','22','33','44'])
    w1.writerow(["chenfenping","","",""])
    w1.writerow(["cx"])

 

相关文章:

  • 2022-12-23
  • 2021-09-30
  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
猜你喜欢
  • 2021-11-21
  • 2021-12-19
  • 2022-12-23
  • 2021-09-30
  • 2022-02-08
  • 2022-12-23
相关资源
相似解决方案