If guys can help me solve that problem i will be appreciate it.
def busca(valor): with conecta() as conexao: with conexao.cursor() as cursor: