import sqlite3fme = 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()
添加回答
举报
0/150
提交
取消