Posts by Pedro Pinheiro • 248 points
10 posts
-
-1
votes2
answers140
viewsQ: How to return error message with API
Good morning, I’m trying to return error message when something goes wrong in the api, I’ve done it for all the request of the api, but for one specific error, the action that shows all users that…
c#asked Pedro Pinheiro 248 -
0
votes1
answer32
viewsQ: Create multiple select options with Jquery
Good afternoon, what I’m trying to do is a button where clicking creates a select option, but I can create as many times as I want. my select with database connection; <select…
-
0
votes1
answer56
viewsQ: How to avoid the intersection of 2 objects
I have a game problem I’m developing. The problem is, I’ve got two planes that can stand on top of each other and I don’t know what to do, any suggestions? Plane code1 int vBola=550; int CBola=600;…
-
1
votes1
answer23
viewsQ: How to Format a Date of Bytes(Pyhon)
Good afternoon I have the following doubt, I would like to print the date as follows for example 5/24/2019 but what this happens is the following print(date) Data: b'20290510113138Z' I have the…
pythonasked Pedro Pinheiro 248 -
-1
votes2
answers750
viewsQ: Convert a byte variable into a string?
Good afternoon liked to convert a byte variable into string. I have the following code; print(str.encode(frase)) which gives the following output; b'Ola' and wanted before; Ola I found a way to…
-
3
votes1
answer554
viewsQ: What does the f = Fernet(key) code represent when using the cryptography.Fernet library?
The program consists of encrypting a message with a key and then decrypting. from cryptography.fernet import Fernet key = Fernet.generate_key() f = Fernet(key) token = f.encrypt(b"my deep dark…
-
0
votes3
answers347
viewsQ: Return the oldest person from a list with tuples
The question is this: ; Consider that a person has the format Tuplo - (name, year of birth, city). Create a senior function that receives a list of people and returns the oldest person in the group.…
-
1
votes1
answer115
viewsQ: How to find the lists that have a certain desired item
I would like to check if a specific item in a list is equal to "Aberta". def mostrar(): with open("ficheiro2.txt") as arquivo: i=0 for linha in arquivo: linha = eval(linha) if linha[i][2]=="Aberta":…
-
2
votes1
answer4177
viewsQ: How to create a list and put other lists inside?
def annexsentence(): nome_tarefa=input("Nome da Tarefa :") data_atual = datetime.datetime.now().strftime("%d-%m-%y") data_final=input("Data Final :") estado="Aberta"…
-
4
votes2
answers379
viewsQ: Recover List Written in Python File
I’d like to go to my file that contains the following ['teste1', '27-12-18', '12/5/2015', 'Aberta'] ['teste2', '27-12-18', '6/7/7', 'Aberta'] ['teste3', '27-12-18', '12/5/6', 'Fechada'] and only…