2
I want to add 1 to a counter that is represented as a string. the goal is to get the sequence of numbers later. For example: from 000570370 to 000570371.
part of the code:
def rangeOrdemServ(self):
db = self.conexaoBanco()
cursor = db.cursor()
cursor.execute("SELECT ordem_serv_num FROM ordem_serv ORDER BY id DESC LIMIT 1")
dadosOrdemServ = cursor.fetchone()
db.commit()
global rec
dados1 = [dadosOrdemServ]
dados2 = [1]
dados3 = (dados1) + (dados2)
self.entrOrdServ.insert(END,dados3)
when I run this code get the following answer:
[('000005703701021',), 1]
, and not the expected 000005703701022
Why are the clasps?
– Pablo Almeida
without brackets of the following error: 'data3 = data1 + data2 Typeerror: can only concatenate tuple (not "int") to tuple'
– Diunior Ronaldo Brum Lauser
dadosOrdemServ
is a String. Do you want to treat it as a number to add up 1? Is that it? Because, if it is, it has nothing to do with concatenation.– Pablo Almeida
Yes it is, I work a short time with python, I do not have much experience, can help me with this question?
– Diunior Ronaldo Brum Lauser