Questions tagged as 'python'

1
answer

Error in the list conversion in Python

I have the following problem: lista1 = [3,4,5] list(map(lambda x: x**3, lista1)) You gave this error: TypeError Traceback (most recent call last) <ipython-input-14-5e26f3f7b396> in <module>() 2 lista1 = [3,4,5] 3 l...
asked by 19.09.2018 / 22:27
2
answers

Logic to get the lowest read value of the user

What's wrong with my logic? I can not return the smallest value def menor(size): size = size vet = [0] * size menor = 0 for i in range(size): vet[i] = int(input('Digite os valores: ')) if vet[i] > menor:...
asked by 26.03.2018 / 03:39
0
answers

M2M loading too slow in django

In some tables I use many to many, and as the database has grown its load time is increasing (of course), I've got an alternative to loading, which is raw_id_fields, but it does not demand as desired, if the raw id displayed the "name" instead o...
asked by 18.09.2018 / 17:13
0
answers

Problem loading color detected by arduino

I have a problem loading information into Arduino via pyserial. I'm using a python and opencv script to do color detection via webcam. For each detected color, I want to inform the Arduino so he can make a decision. But I can not send the dat...
asked by 17.09.2018 / 14:35
1
answer

shopping script, in the txt file the name of the shopping objects, do not stand below each other

print('Programa de controle: Lista de compras 1.0') numero_compras = input('Numero de itens: ') lista_compras = [] i = 1 while i <= int(numero_compras): nome_compras = input('Preencha com o nome da compra #' + str(i) + ': ') lista_co...
asked by 23.09.2018 / 04:09
0
answers

How to get span text? but when one has an img in that span of error!

The following code gets the span , but if it has a img it has an error. user = driver.find_element_by_xpath('//span[@title = "{}"]'.format(names)) user.click() My system takes title from span and clicks it. But wh...
asked by 14.09.2018 / 18:13
0
answers

Django: TypeError: 'sslmode' is an invalid keyword argument for this function

Error executing python manage.py runserver: Virtual env python 3.7.0 or 3.6.6 django 2.1.1 or 2.0 System check identified no issues (0 silenced). Unhandled exception in thread started by .wrapper at 0x000001BC0DC7FF28 > Traceback (most...
asked by 18.09.2018 / 20:12
0
answers

GUI in Python using Guizero and Raspberry Pi

I am working on my electrical engineering course completion project and need to perform a front end for graphical interface visualization for data verification. I'm using raspberry pi 3 and the guizero library to create an initial layout, how...
asked by 18.09.2018 / 22:49
0
answers

Problem in logic, how to stop an infinite loop under such circumstances?

I'm having a logic problem here: I'm developing a script for automating tasks, and I need to select the floor button. It runs every step in the established order without stopping (or while the stop_onclick button is not pressed) but I also need...
asked by 21.09.2018 / 23:33
0
answers

How do I make a function to calculate a factorial without recursion? [duplicate]

def fatorial(n): if n <= 1: return 1 else: return n * fatorial(n - 1) I would like to know if I can consider this without recursion, I did not quite understand how recursion is and how to do a function that calcula...
asked by 19.09.2018 / 13:56