您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

在Python中编写一个可在Windows中同时适用于Python 2.7+和Python 3.3+的.CSV文件

在Python中编写一个可在Windows中同时适用于Python 2.7+和Python 3.3+的.CSV文件

我已经尝试了几种方法。据我所知,简单的使用'w'可能是一个解决方案:

with open('test.csv', 'w') as csv_file:
    writer = csv.DictWriter(csv_file, fieldnames=['header1', 'header2'], lineterminator='\n')
    # write something
python 2022/1/1 18:44:41 有304人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶