Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: python csv阅读器行为,无和空字符串
读取 csv 文件时,阅读器将None或读取NULL为(u''). 在将值插入 sqlite 数据库并执行查询时,这给我带来了问题,因为所有空值都存储为空字符串。有没有办法使用阅读器插入空值?到目前为止,我所拥有的是:
None
NULL
(u'')
reader = csv.reader(open(filename)) curs.executemany("INSERT INTO mytable VALUES (?,?,?,?)", reader)