diff options
Diffstat (limited to 'dict.py')
-rwxr-xr-x | dict.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -10,8 +10,6 @@ __debug = True class Dict: - level_1 = () - def __init__(self, sqliteDB = None): if sqliteDB == None: @@ -35,6 +33,9 @@ class Dict: self.cur.execute("SELECT COUNT(wordid) from las_word where length = ?", (length, )) self.num_words = self.cur.fetchone() return self.num_words + + def exit_game(self): + self.conn.close() def get_random_wordid(self, length=0, numwords = 1): @@ -188,7 +189,8 @@ class Word: self.cur.execute("UPDATE las_phoneme SET phoneme = " + phoneme +", is_correct = 0 where wordid = ?", (self.wordid,)) self.conn.commit() - + def exit_game(self): + self.conn.close() if __name__ == "__main__": k = Dict() num_words = k.get_num_words() |