文章詳情頁(yè)
python - 使用sqllite的conn.total_changes()問(wèn)題
瀏覽:148日期: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. docker-compose中volumes的問(wèn)題2. boot2docker無(wú)法啟動(dòng)3. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””4. docker安裝后出現(xiàn)Cannot connect to the Docker daemon.5. java - SSH框架中寫(xiě)分頁(yè)時(shí)service層中不能注入分頁(yè)類(lèi)6. nignx - docker內(nèi)nginx 80端口被占用7. dockerfile - 為什么docker容器啟動(dòng)不了?8. 關(guān)于docker下的nginx壓力測(cè)試9. node.js - antdesign怎么集合react-redux對(duì)input控件進(jìn)行初始化賦值10. docker容器呢SSH為什么連不通呢?
排行榜

熱門(mén)標(biāo)簽
網(wǎng)公網(wǎng)安備