Python读写csv文件
来源:互联网 发布:java应用服务器是什么 编辑:程序博客网 时间:2024/04/29 23:12
1. 写入并生成csv文件
代码:
代码:
csvfile=file('E:\temp.csv','wb')writer=csv.writer(csvfile)writer.writerow(['姓名','年龄','电话'])data=[ ('小','25','1234567'),('大','23','789')]writer.writerows(data)csvfile.close()2、读csv文件
代码:
cvsfile_r=file('E:\t1.csv','rb')reader=csv.reader(cvsfile_r)for line in reader: print line[0],line[1]cvsfile_r.close()
0 0
- Python读写csv文件
- python 读写 csv文件
- Python读写csv文件
- Python读写csv文件
- Python读写csv文件
- Python读写csv文件
- Python读写csv文件
- Python读写csv文件
- Python读写csv文件
- Python读写csv文件
- Python读写csv文件
- python读写csv文件
- Python 读写CSV文件
- python 读写csv文件
- python 读写CSV 文件
- Python读写CSV文件
- python 读写csv文件
- python使用csv模块读写csv文件
- NYOJ 737 石子合并(一) (区间DP+平行四边形优化)
- 导出C/C++API给Lua使用
- BitBlt 画透明位图
- poj 并查集 - 2492 A Bug's Life
- HDU 1425--sort【水题】
- Python读写csv文件
- Error Code: 1630. FUNCTION rand.string does not exist
- 国外程序员整理的 C++ 资源大全
- openstack学习笔记----Nova和 AMQP
- noj算法设计——迷宫问题
- 用两个栈实现一个队列
- 斜率优化 DP
- acm入门
- linux基础1