Message from Python discussions

December 2018

— Help please.
this is my code:

sql = "INSERT INTO tb_ligacoes (tipo, data, data_hora, agente, ramal, fone, duracao) VALUES (%s, %s, %s, %s, %s, %s, %s )"

dados = ("'"+subitem.find("tipo").text +"', '"+subitem.find("data").text+"', '"+subitem.find("data_hora").text+"', '"+subitem.find("agente").text+"', '"+subitem.find("ramal").text+"', '"+subitem.find("fone").text+"', '"+subitem.find("duracao").text+"'")
mycursor.execute(sql, dados)

#Commitando dados

after execute, the mysql show this error:

mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s, %s, %s, %s, %s, %s, %s )' at line 1

Message permanent page


Hey guys i have a problem with writing a code that should run on passwords from dictionary and open Zip file

— Show your code and the problem you're having

— Hi everybody!! Some have a list of exercises to solve from beginner to expert?

— I am trying to learn codes from python documentation but can't remember them i forget the codes in 2-3 days 😭

Message permanent page

— Just continue practicing

— Just keep practicing, its like learning how to walk and eventually you’ll learn to run

— What should I write in both files, if pkg.a requires pkg.b?

— Thx a lot

— Running from .b import * in seemed to work but I don't think that is correct anyway

— 👍🙃😄😄 yeah but maybe i need to write same code 5-10 times brain can forget the codes but finger can't

— 🙃yeah brother