Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/363.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python SQLite删除中的行_Python_Sqlite - Fatal编程技术网

Python SQLite删除中的行

Python SQLite删除中的行,python,sqlite,Python,Sqlite,这与其他人的问题类似,但没有人明确解释如何纠正这一问题: process.py 输出: $ python process.py 824 rows 822 rows $ python process.py 824 rows 822 rows 我知道SQL查询很好,因为我可以通过其他sqlite“客户端”(如firefox sqlite manager插件)成功运行它们。对,需要在连接时提交: cursor.close() connection.commit() # <<<

这与其他人的问题类似,但没有人明确解释如何纠正这一问题:

process.py

输出:

$ python process.py 
824 rows
822 rows
$ python process.py 
824 rows
822 rows

我知道SQL查询很好,因为我可以通过其他sqlite“客户端”(如firefox sqlite manager插件)成功运行它们。

对,需要在连接时提交:

cursor.close()
connection.commit()   # <<<<< !!
connection.close()
cursor.close()
commit()连接#
cursor.close()
connection.commit()   # <<<<< !!
connection.close()