print(index)
split = index.split(',')
split = split[0].split(' ')
print(split)
print(split[1])
if split[1] == '': ####It's working
c.execute("SELECT * FROM registros WHERE ID = ?", split[2])
for row in c.fetchall():
c.execute("UPDATE registros SET datasaida = ?,valor = ? WHERE ID = ?", (dateout, valor, split[2]))
else: ####It's not working
a = split[1]
c.execute("SELECT * FROM registros WHERE ID = ?", str(split[1]))
for row in c.fetchall():
c.execute("UPDATE registros SET datasaida = ?,valor = ? WHERE ID = ?", (dateout, valor, split[1]))
10,qwerwe 30/11/2017 13:45
['','10']
10
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\ThomasCaio\AppData\Local\Programs\Python\Python36-32\lib\tkinter\__init__.py", line 1699, in __call__
return self.func(*args)
File "C:/PycharmProjects/Project/Program.py", line 399, in <lambda>
but1 = ttk.Button(pop,text='Encerrar serviço',command=lambda:self.Saida())
File "C:/PycharmProjects/Project/Program.py", line 422, in Saida
c.execute("SELECT * FROM registros WHERE ID = ?", str(split[1]))
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 2 supplied.
if运作良好 但是具有相同代码的else不起作用 发生了什么?