Posts by Alexandre Simões • 62 points
9 posts
-
-1
votes0
answers28
viewsQ: How to update a executable
I have an app .exe in python and I need to make this executable check for a new version, and upgrade on the computer. I found solutions like: Rename the current . exe, run the new and delete the…
-
0
votes1
answer29
viewsQ: Pandas group into groups with a determining range
beauty? I’m trying to group values of a dataframe called df_agenda by age, wanted to group the values in this way in the age: of (0-20),(20-40), (40-60) and so up to the maximum value of the list of…
-
0
votes1
answer65
viewsA: How to remove n while reading lines from a file
Two ways: (There are several) import matplotlib.pyplot as plt def func(a: str): lista = [] for i in a: lista.append(i.replace('\n', '')) return lista lst = open(("wealth-per-country.csv"),…
-
0
votes4
answers177
viewsA: Insert names to a list depending on their value
Simplistically, there is a more dynamic hint to create this draw: valor = int(input('Digite o valor que você deseja doar: ')) nome = input('Qual o seu nome? ') nomes = [] valor //= 10 # Equivalente…
-
2
votes3
answers84
viewsA: Copy between strings inside Python lists
Recursively, you might want to play a little more: lista = ['a', 'b', 'c', 'd', 'e'] coluna = ['a', '1', '2', '4', 'b', '2', '4', '5', '6', 'c', '3', '3', '3', 'd', '3', '3', 'e', '1'] nova = [] def…
-
-1
votes2
answers56
viewsQ: Overload of error operator
The code below is with the following error: Error: [Error] invalid operands of types 'Ponteiro*' and 'Ponteiro*' to binary 'operator+' Code: #include <iostream> using namespace std; class…
-
-3
votes2
answers50
viewsA: Python - Doubt-transform into Dataframe
import pandas as pd cursor.execute('SELECT ROTAID,DESCRICAO FROM ROTAS') df = pd.DataFrame(columns=["ROTAID", "DESCRICAO"]) for row in cursor: df = df.append({ "ROTAID": row['ROTAID'], "DESCRICAO":…
-
2
votes1
answer45
viewsA: Insert INTO mysql and python error
You need to quote the date, it treats the number you are sending as a subtraction. Ex: INSERT INTO produtos (nome_produto, marca, preco, validade, qtd_estoque) values ('Brahma Chopp 269ml',…
-
0
votes1
answer37
viewsA: How to find a certain value in a line that contains a keyword - python
If the file has only the line in this format: "EXTRACT 05978754" Just read the file line by line: import re for linha in open("P:/portal/cupons/Arquivos_Espelho/arqEspelho.txt", "r").readLines(): if…
pythonanswered Alexandre Simões 62