用类封装一个数据库的增删改查的简单操作
# coding:utf-8
import sqlite3
class dbUser(object):
def __init__(self):
self.conn = sqlite3.connect(':memory:')
self.c = self.conn.cursor()
self.c.execute('''CREATE TABLE USER
(NAME TEXT NOT NULL,
AGE INT NOT NULL,
JOB TEXT NOT NULL);
''')
def insert_data(self, datas):
for i in datas.values():
self.c.execute("I