Questions tagged as 'python'

1
answer

Pass different values to a string without repeating the same

I need to pass different values to the url, as you can see in the example, first I pass the values contained in dt_3, the problem is that I need to pass the rest of the values to all the url, that is, dt_7 and dt_31. How can I simplify the pr...
asked by 17.10.2018 / 15:43
1
answer

list comprehensions

I am learning python and I have discovered the concept of "list comprehensions" (I do not know if it has a Spanish translation). I was doing tests to understand it and I did not finish clarifying myself. For example, if I want to show the...
asked by 07.10.2018 / 13:08
1
answer

Python error with elif conditionals not taken into account

The error is that when I execute my code with the conditional if it executes it well but when I try the elif it does not take it into account and goes directly to the if for some reason. Here the code: nombre_usuario=str(input("como debo de ll...
asked by 10.10.2018 / 18:06
1
answer

Problems with menu in python

This is what I have def Menu(): #Muestra en pantalla la imagen guardada en Ganag screen.blit(Menug, (0,0)) #Actualizará el contenido de la pantalla entera for event in pygame.event.get(): dificultad =0 if event.type ==...
asked by 10.10.2018 / 05:24
1
answer

Type Error (Type Error) when iterating over columns of an array (nested lists) and printing them

Given this list of lists: grid = [['.', '.', '.', '.', '.', '.'], ['.', 'O', 'O', '.', '.', '.'], ['O', 'O', 'O', 'O', '.', '.'], ['O', 'O', 'O', 'O', 'O', '.'], ['.', 'O', 'O', 'O', 'O', 'O'], ['O', 'O'...
asked by 01.10.2018 / 23:02
2
answers

Context processor for templates | ValueError - Django

Very good friends, I have my custom context processor, so that it can be used in all the django project templates in the form of a variable: {{ u_model }} This is my context processor: proccesors.py from django.contrib.auth.decorator...
asked by 17.09.2018 / 22:11
1
answer

My code does not return the actual value of the QWidget

Good evening I have the following code: The error that occurs to me is that when I print the size of self.widget.width() I get the value of 100 while in the QT Designer I show that the value is 450 The second error is that when you pas...
asked by 22.09.2018 / 07:34
1
answer

Why the variable does not change the value

I have the following code where I initialize three variables g_turno , g_sucursal , g_fecha with any value. These variables should change their value respectively when the following signals are activated: self.turno_1.cur...
asked by 03.09.2018 / 18:47
1
answer

Insert data in comboBox

I have the following code, the result of the cursor returns the correct data, the problem that the comboBox does not show, is the correct way to fill it? print([str(x[0]) for x in cursorUsuario])    ['1', '4', '5', '6', '9'] self.dlg.com...
asked by 16.08.2018 / 00:57
4
answers

how can I use input validation to request a positive number and continue the program?

I would like an output like this: (I would prefer to use only while and Boolean expressions if possible.) escribe un numero: -50 debes usar un numero positivo! escribe un numero: -200 debes usar un numero positivo! escribe un numero: 200 esc...
asked by 30.10.2018 / 01:47