python int占用多少字节数_python int() 参数必须是字符串,类似于对象或者数字的字节,而不是'tuple'_python_酷徒编程知识库...

因這裡我在本節中的代碼應該從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]

這是錯誤

先謝謝了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值