Questions tagged as 'python-3.x'

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

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
1
answer

How to condition serializer? DjangoRestFramework

I have the following serializer: class PerfilSerializer(serializers.ModelSerializer): usuario = UserSerializer() seguidores = serializers.PrimaryKeyRelatedField(many=True, read_only=True) looks = LookSerializer(many=True, read_only...
asked by 16.05.2018 / 16:18
2
answers

How to render the form from the template and see it in admin

I'm using Django 1.11.4, root app url(r'^contacto/', include('contacto.urls'), name='contacto'), contact_app / urls.py from django.conf.urls import url, include from contacto.views import contacto urlpatterns = [ url(r'^$',...
asked by 08.05.2018 / 02:12
1
answer

Problems with Django, when installing the cymysql plugin to connect to the database

What I am using: Operating system: Debian 9 Database: MySQL 5.5 Django 1.11.4 I execute the command: python manage.py migrate The following error message is displayed in the terminal: django.core.exceptions.ImproperlyConfigured...
asked by 28.02.2018 / 04:46