import sqlite3 as db
import os
if
name=="
main":
if os.path.exists("./output/test.db"): os.remove("./output/test.db")conn_write = db.connect(‘./output/test.db‘)cursor_write = conn_write.cursor()cursor_write.execute("CREATE TABLE nav_test ( test_id varchar(128) default ‘‘, value smallint default 0);")rootdir = ‘./test/‘ list = os.listdir(rootdir) //循环打开test 目录下面的所有sqlite文件 for i in range(0,len(list)): path = os.path.join(rootdir,list[i]) conn_read = db.connect(path) cursor_read = conn_read.cursor() rows = cursor_read.execute("......") //逐行读取数据 for line in rows: str1 = line[0] str2 = line[1] ...... ..... ..... cursor_write.execute("INSERT INTO nav_test VALUES (‘{0}‘, ‘{1}‘); ".format(str1,str2))