Questions tagged as 'python'

1
answer

Iterate over the current selector with XPath and Scrapy

I am scribbling information but I am stuck in the for loop. First, when I receive the answer, I create an xpath "root" to call it. This xpath root has one and every one of the items in a tag ul Then I pull out each of the data I need, but...
asked by 28.09.2018 / 21:51
1
answer

Find a key within a dictionary by means of a value

I would like to be able to find a key within a dictionary by means of a value entered. The example is as follows. diccionario = {'jorge' : 1, 'andrea' : 4} buscar = int(input("Introduce numero: ")) for nombre, numero in diccionario.items():...
asked by 07.10.2018 / 00:26
1
answer

Show all combinations by multiplying all the numbers in a matrix

Particles of a matrix of three columns and an indefinite number of rows.The numbers of the first and second row can be any number, and the third column is always a column of 1. Let's say that the number of rows is 5, and we have for example the...
asked by 23.09.2018 / 18:37
1
answer

Grammatical Terminal Symbols and Non-Terminals PYTHON?

I am doing a program for my automaton class. But now they have asked us for a somewhat complicated program and I would like them to help me with some detail (I do not want them to do my homework, but I am looking for ideas) The problem is, that...
asked by 05.11.2018 / 03:21
1
answer

AttributeError: 'Data' object has no attribute 'dragPosition' Python

I have the following problem, I have the following piece of code that I use to be able to move the MainWindow. def mousePressEvent(self,event): if event.button() == QtCore.Qt.LeftButton: self.dragPosition = event.globalPos() - self...
asked by 24.08.2018 / 04:20
1
answer

Isolate Qwidget from a function

How can I isolate the widget self.combo_login , the functions mousePressEvent and mouseMoveEvent ?, This is so that when the mouse is clicking on the self.combo_login these functions are not executed: code: fro...
asked by 24.08.2018 / 07:24
1
answer

NameError: name 'x' is not defined - Python - Django

I have a code that marks me an error of an undefined variable, but I do not know why. This is my Model: models.py class Model(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, null=True) valor = models.Flo...
asked by 30.08.2018 / 06:27
1
answer

Error writing data in inertial sensor

I have managed to read the calibration values of the sensor and save them in a file. The problem I have is when I want to insert these values into the sensor, it throws some errors that I can not explain why I put the script and your help wil...
asked by 18.08.2018 / 01:23
2
answers

Determine if a number of two digits belongs to the fibonacci series

I need to determine if a two-digit number belongs to the fibonacci series, I have the following code: '''Leer un número de dos dígitos y determinar si pertenece a la serie de Fibonacci. Con ciclos.''' numero1 = int(raw_input("Digite un numero...
asked by 29.08.2018 / 03:10
1
answer

type 'exceptions.ValueError': invalid literal for int () with base 10: '19065171.'

I have the following code: for i in range(0, len(terceros_df.NIT)): print 'esto es i =', i number = terceros_df.iloc[i]['NIT'] length = len(str(number)) if length == 10: str_number = str(number) nit = str_number...
asked by 22.10.2018 / 17:30