我尝试使用以下代码行在 sqlite3 中创建数据库表
import sqlite3
con = sqlite3.connection(":memory:")
conn = sqlite3.connect("customer.db")
#before you create a table, create your cursor. a cursor is what tells your database what you want to do
c = conn.cursor()
c.execute("""CREATE TABLE Customers (
first_name text,
last_name text,
email text,)""")
conn.commit()
conn.close
当我运行代码时,使用 cmd 时出现操作错误,使用 Powershell 时出现语法错误。
我期待代码在 sqlite 中创建一个表。