Questions tagged as 'python'

3
answers

Convert query to Python list

I want to convert this query Clientes.objects.values() in a list to later use the Chartkick graphs but with the values that it returns to me. The Clientes model is: class Clientes(models.Model): Nombre = models.CharField(m...
asked by 28.03.2016 / 17:59
1
answer

You doubt about multiplying items in a list

I'm doing an exercise in Codecademy, specifically this one: Modify each element of a list in a function The case, that the code that I'm trying to use is this: n = [3, 5, 7] def doble_lista(x): for i in range(0, len(x)): x[i]=x[i]*2 return x...
asked by 03.08.2016 / 15:07
1
answer

how to get OS processes with python

I wanted to know if there is any way to make python able to know which processes are open in my OS (win 7 in my case) ex: [I have google open] print "los procesos abiertos son:", procesos the open processes are: google.exe I hope t...
asked by 22.07.2018 / 03:25
2
answers

replace items in nested lists in python

I want to replace items in lists of lists to draw a cross. So for example the list: x="X" lista =[[x," "," "," ",x],[" ",x," ",x, " "],[" "," ",x," "," "],[" ",x," ",x, " "],[x," "," "," ",x]] for l in lista: print (" ".join(l)) re...
asked by 06.08.2018 / 06:30
2
answers

Reading data from the serial port hangs my GUI

I'm doing an access control application in Python. I have a window in PyQt5, which has a running clock and a connection to an Arduino, which is the one that will read a card through its corresponding NFC. The fact is that for the two tasks (c...
asked by 07.07.2018 / 21:56
1
answer

Perform operation when detecting the change in a QtableWidget item

I have a QTableWidget , of 3x5 in the item (5, 5) I do the sum of the number that enter inside the item (1,2) and (1,3). Currently I need the user to click on a update button to be able to perform the update but I would like to know i...
asked by 01.09.2018 / 20:42
1
answer

Create named files that include rare characters

I've been looking for too much but I have not found the answer, the case is this: With PHP I have to get the list of the files of a directory. I have to save the list in a file with JSON format, for which I use json_encode() . I sa...
asked by 12.01.2018 / 18:56
1
answer

matrix staggering in python

I have problems when trying to stagger a 5x5 matrix. First I made a null line go to the last row of the matrix (it worked), then I tried to make a row with the highest index fall below the one with the lowest index, but on the line: if pivos_i...
asked by 14.10.2017 / 20:05
1
answer

getattr in pony generators orm

I have the following problem (whose answer I fear is that it does not support it). I have verified that this sentence runs without problems: res = tuple(Cliente.select(lambda c: c.nombre == "Pepe")) But my problem is that name is inside a...
asked by 02.03.2016 / 09:04
1
answer

API on ReportLab with Django

Well, I have this doubt because I have not found good documentation about it, there is a specific doubt at the moment and it is with the images. from reportlab.lib import colors from reportlab.lib.units import cm from reportlab.lib.enums impor...
asked by 10.03.2016 / 21:25