import sqlite3 conn_source = sqlite3.connect('db/source.db') conn_target = sqlite3.connect('db/memos_prod.db') cur_source = conn_source.cursor() cur_target = conn_target.cursor() #? change here cur_source.execute('SELECT * FROM tag') rows = cur_source.fetchall() #? change here for row in rows: cur_target.execute('INSERT INTO tag VALUES (?, ?)', row) # 假设表有两列 conn_target.commit() conn_source.close() conn_target.close()