INSERT INTO .db 什么都不做。为什么它不起作用?

import sqlite3

fme = open("bestFME.txt", "r")

ln = open("numberline.txt", "r")

lines = fme.readlines()

nums = ln.readlines()

numbers = []


for i in nums:

    numbers.append(int(i[0:-1]))

db = sqlite3.connect("FME111.db")

db.execute("CREATE TABLE IF NOT EXISTS mn(word TEXT, meaning TEXT)")

a = ""

b = ""

for i in range(0, len(numbers)-1):

        a = ""

        b = ""

        a += lines[numbers[i]+1]

        for k in range(numbers[i]+2, numbers[i+1]):

            b += lines[k]

            db.execute("INSERT INTO mn(word, meaning) VALUES(?, ?)", (a, b))


db.close()


收到一只叮咚
浏览 149回答 2
2回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python