class QuizDatabse: def init(self, dbname = 'quiz.db'): self.conn =…
Jump to turn (8)
- 1class QuizDatabse: def init(self, dbname = 'quiz.db'): self.conn = sqlite3.conne
- 2self.db.addquestion(question['id'], question['type'], question['text'], None, No
- 3我在 jupyter lab 中有一个quiz 目录中存在一个 quezdatabase.py 文件,我想在 jupyter 中import 这个文件要怎么操作
- 4使用 python 操作 sqlite 过程中提示 OperationalError: database is locked 什么原因?
- 5File ~/Documents/PythonENVs/web-crawler/./quiz/quizdatabase.py:58, in QuizInterf
- 6如果 sqlite 的 床
- 7如果 sqlite 的 id 要存入 "24d96b69eaa94d63b5670b477526bcce" 形式的要如何创建表?它还是整数型吗?
- 8def addquestion(self, id, type, text): self.cursor.execute(''' INSERT INTO quest
- User
class QuizDatabse: def init(self, db_name = 'quiz.db'): self.conn = sqlite3.connect(db_name) self.cursor = self.conn.cursor() self.create_table()
codedef create_table(self): self.cursor.execute(''' CREATE TABLE IF NOT EXISTS questions ( id INTEGER PRIMARY KEY, type TEXT, text TEXT, answerID INTEGER, answer TEXT ) ''') self.conn.commit()这里是 Python 的部分代码,在 "create_table()" 方法中,我期望的是 answerID, answer 可以为空,那么我 sqlite 创建表的语法是否需要修改
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.