Questions tagged as 'python'

1
answer

render a pygal graphic in a Qlabel

Good morning I'm trying to show a graph in a qlabel with pixmap and pygal, however it does not work, it throws me an error qn QPixmap from PyQt5 import QtCore, QtWidgets, QtSvg import pygal from PyQt5 import uic from PyQt5.QtGui import QPixmap...
asked by 14.09.2018 / 17:47
1
answer

With Django 'str' object is not callable in class based-views

I have this problem when I want to access a URL that tells me that it is str object is no callable surely I have something wrong in the urls or a configuration of those but the truth is that I have reviewed all the files well and I do not...
asked by 31.08.2016 / 17:43
2
answers

Dictionaries within a dictionary, python 3

I have a dictionary with lists: d1 = { 'frutas': { ' manzanas': [' verdes', ' 7', ' rojas', ' 5'], 'uvas': [' negras', ' 5', ' verdes', ' 3'] }, ' verduras': { 'papa': ['negras', ' 50', ' blancas', ' 20'], 'cebol...
asked by 16.10.2018 / 00:15
1
answer

Problem with Combobox in Frame "scrollable", the scroll event passes to the father

I'm doing a desktop application with Tkinter and Python. I have inserted a drop-down control ttk.Combobox for several options but I have a problem. The combobox is inside a frame with scroll bar and when under the mouse wheel the c...
asked by 29.08.2018 / 11:14
1
answer

How to add all the values of a column - Django

I would like to know how to add all the data in a column of my database. This is my model: models.py class Model(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, null=True) id = models.AutoField(primary_k...
asked by 01.09.2018 / 17:49
1
answer

Why will not django admin let me in?

I have a problem when starting the Django admin. When I'm going to put the username and password (which are the correct ones and with the creation of superuser) it tells me that one of the fields is not correct. What can I do in this case and...
asked by 02.09.2018 / 17:26
2
answers

Sending of variable captured from a form .pyw with tkinter to an independent function in a .py

Hello everyone I am new to python, I hope you can help me, the problem I have is the following. I have a form (tkinter) .pyw where I collect some data and I intend to take them to an independent function that runs in parallel from a py. I'...
asked by 08.10.2018 / 04:12
1
answer

Error using d3: "d3 is not defined"

I am starting to do my pininos with d3 in Python (using Jupyter ), with something very simple, but no matter what I do, I have errors. Go the code: from IPython.core.display import HTML, Javascript import json #Llamo a d3...
asked by 04.12.2018 / 01:45
2
answers

how do I multiply the value in python

How do I want the result to be 4 and not to be 'aa' of the following source code? set1=input ('Entra letra para multiplicar su valor en numero x2: ') a=2 b=3 c=4 d=5 e=6 muestra=2*set1 print (muestra)     
asked by 19.07.2018 / 06:30
2
answers

use goto in python

I have the following Script. For .py extention of python to do GOTO but I do not know if this works in Phyton v3.3.3 os.system('cls') if Resultados1 == 0: Resultados1 = 0 goto .Nivel_1 if Resultados2 == 0: Resul...
asked by 26.07.2018 / 02:47