如何用python读入csv文件

如题所述

class DBI(object):
"""database interface"""
def __init__(self, conn):
"""keep connection"""
self._conn = conn
def store(self, sql, data):
"""store data into database with given sql"""
curr = self._conn.cursor()
curr.executemany(sql, data)
self._conn.commit()
curr.close()
def execute(self, sql, *args, **kwgs):
"""execute sql on database"""
curr = self._conn.cursor()
curr.execute(sql, *args, **kwgs)
self._conn.commit()
curr.close()
温馨提示:答案为网友推荐,仅供参考
相似回答