文章詳情頁(yè)
python - 使用sqllite的conn.total_changes()問(wèn)題
瀏覽:75日期:2022-08-14 08:47:19
問(wèn)題描述
版本3.5
def Exec(self, sql, param=None):conn = sqlite3.connect(self.path)try: if param is None:conn.execute(sql) else:conn.execute(sql, param) conn.commit()except Exception as err: print(err)finally: result = conn.total_changes() conn.close()return result
sql 是 insert into Config values(null,’aaa’,’aaa’,’2017-03-30’,0)然后 result = conn.total_changes()位置報(bào)錯(cuò)’int’ object is not callable
問(wèn)題解答
回答1:意思就是conn.total_changes是個(gè)int。result = conn.total_changes 就行,不要加()
相關(guān)文章:
1. python - 數(shù)據(jù)與循環(huán)次數(shù)對(duì)應(yīng)不上2. mysql - 把一個(gè)表中的數(shù)據(jù)count更新到另一個(gè)表里?3. 請(qǐng)教使用PDO連接MSSQL數(shù)據(jù)庫(kù)插入是亂碼問(wèn)題?4. mysql - 分庫(kù)分表、分區(qū)、讀寫(xiě)分離 這些都是用在什么場(chǎng)景下 ,會(huì)帶來(lái)哪些效率或者其他方面的好處5. Python爬蟲(chóng)如何爬取span和span中間的內(nèi)容并分別存入字典里?6. 視頻文件不能播放,怎么辦?7. mysql 查詢身份證號(hào)字段值有效的數(shù)據(jù)8. python - 爬蟲(chóng)模擬登錄后,爬取csdn后臺(tái)文章列表遇到的問(wèn)題9. node.js - nodejs開(kāi)發(fā)中常用的連接mysql的庫(kù)10. 黑客 - Python模塊安全權(quán)限
排行榜

熱門(mén)標(biāo)簽