1. 首页
  2. 数据库
  3. 其它
  4. python读取csv文件示例(python操作csv)

python读取csv文件示例(python操作csv)

上传者: 2020-12-31 15:44:04上传 PDF文件 24.83KB 热度 68次
复制代码 代码如下:import csvfor line in open(“test.csv”):name,age,birthday = line.split(“,”)name = name.strip(‘ \t\r\n’);age = age.strip(‘ \t\r\n’);birthday = birthday.strip(‘ \t\r\n’); print (name + ‘\t’ + age + ‘\t’ + birthday) csv文件 复制代码 代码如下:alice, 22, 1992/03/05bob, 33, 1981/11/21cart, 40, 1974/07/13
用户评论