SQLite python不更新表

use*_*286 5 python sql sqlite

我有以下代码:

import sqlite3

con = sqlite3.connect("testDB")
cur = con.cursor()

#cur.execute('CREATE TABLE test_table (id integer primary key, data text)')
cur.execute('INSERT INTO test_table VALUES (?, ?)', (76, 'MyData'))
Run Code Online (Sandbox Code Playgroud)

当我运行此脚本时,它不会更新表.但是当我在Linux中使用sqlite3命令行进行相同的插入时,它会更新.为什么这样或有什么我做错了?

kev*_*kev 10

# Save (commit) the changes
con.commit()
Run Code Online (Sandbox Code Playgroud)