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()
相关分类