Python - csv file is empty after using csv writer

后端 未结 5 982
终归单人心
终归单人心 2021-01-12 22:19

Python newbie here. I was trying to troubleshoot an issue with writing a csv file in a larger program and decided to go back to basics to try to find the problem.

I

5条回答
  •  有刺的猬
    2021-01-12 23:03

    That code works. Are you sure your OS isn't just rounding down the CSV size -- after all, it will only be a few bytes!

    You can try print(open("eggs.csv").read()) to see whether the file is actually empty, or else more eggs.csv from the command line.

提交回复
热议问题