作者veryhungry12 (hungry1212)
看板Python
标题[问题]读取csv档案
时间Mon Feb 6 18:31:11 2017
http://imgur.com/a/AeXhL
我想读取books1.csv档案,然後插入book.db档案.
可是却显示name 'curs' is not defined.
我也试过前面还用connect(),在用cursor()
可是也显示keyerro:'title'的错误.
想请求帮忙.
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 117.19.177.75
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1486377073.A.1A9.html
1F:→ kenduest: 你的开启 sqlite db - book.db 的叙述程式码没写? 02/06 18:50
2F:→ kenduest: 先开启 db 连线 con = sqlite3.connect('test.db') 02/06 18:55
3F:→ kenduest: 後续用 curs = con.execute(.....) 来执行 sql 叙述 02/06 18:56
4F:→ kenduest: 建议详细看一下 python 官方文件有范例说明 02/06 18:56