版本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()
位置报错
'int' object is not callable
conn.total_changes가 int라는 뜻입니다. 결과 = conn.total_changes, ()를 추가하지 마세요