因这里我在本节中的代码应该从sql数据库获取一个值,然后将值添加到sql数据库中。with sqlite3.connect('aircraft.db') as db:
c = db.cursor()
self.flightcount4 = self.flightcount5.get()
self.flightcount3 = int(self.flightcount4)
c.execute("SELECT flightcount FROM aircraft WHERE Arrive =?",(self.travelselect.get(),))
self.total3 = c.fetchone()
total2 = int(self.total3)
self.total = total2 + self.flightcount3
c.execute('UPDATE aircraft SET flightcount = :flightcount WHERE Arrive = :Arrive',{'flightcount':self.flightcount3, 'aircraftpilot':self.pilotname5 })
db.commit()
ms.showinfo('Success!', 'its saved!')
这是我的代码。Exception in Tkinter callback
Traceback (most recent call last):
File"C:UsersadamAppDataLocalProgramsPythonPython36-
32libtkinter__init__.py", line 1702, in __call__
return self.func(*args)
File"C:A LEVELSComputingatomactual resultsworkingCustomer.py",
line 40, in addtocount
total2 = int(self.total3)
TypeError: int() argument must be a string, a bytes-like object or a
number, not 'tuple'
[Finished in 30.761s]
这是错误
先谢谢了