0
Good morning,
I have a listbox and I’m having a hard time storing the contents of that list in the Mysql database. Someone could help me. I followed code and error below:
def SaveVariosCodBr(self):
db=self.conexaoBanco()
cursor=db.cursor()
listcod = self.ListCodBrGer.get(ALL)
sql="insert into "+self.entrPsCodBr.get()+"(codigo,situacao)values('"+listcod+"','ativo')"
try:
cursor.execute(sql)
db.commit()
print('Dados Gravados')
except MySQLdb as erro:
print('Nao conseguiu Gravar')
db.close()
this is the mistake that:
File "C:\Python27\lib\lib-tk\Tkinter.py", line 2619, in get
return self.tk.call(self._w, 'get', first)
TclError: bad listbox index "all": must be active, anchor, end, @x,y, or a number
format as ?
– Diunior Ronaldo Brum Lauser
and that this is part of the code
– Diunior Ronaldo Brum Lauser