Questions tagged as 'python'

0
answers

Scrapy Python: Do a recursive search on a page

I'm trying to do a recursive search on a web page with Scrapy. I have modified the value in the file of settings.py of DEPTH_LIMIT = 4 and my code is as follows: class HreflocalizeSpider(scrapy.Spider): name = "hrefLocalize"...
asked by 30.04.2016 / 19:04
1
answer

Error executing a query in python with sqlite

I'm trying to insert into a table. This is the code I made: cursor=connection.cursor() cursor.execute('INSERT INTO TopOperadores (imsi_pref_top,descarga_top,transferencia_top) VALUES (SELECT imsi_num, AVG(descarga), AVG(transferencia) FROM...
asked by 16.05.2016 / 03:53
0
answers

Python Flask Log in with OAuth Google [closed]

I am trying to make an application in which users register using an account in Google and Github services. I can not even have them registered by google, and my best attempt was made from:   link The problem is that my html is more complex w...
asked by 19.05.2016 / 04:03
1
answer

Style for word table Python-docx

I am trying to generate a word document with Python, for this I use the python-docx module. I want to establish a very specific style for a table in the word document: 'Grid Table 5 Dark Accent 1'. But this particular style is not found in the l...
asked by 17.07.2018 / 09:03
1
answer

Matplotlib python

I have the following problem: I have a Python script that has a class called "Triangle" which has a method called "plot ()", it returns the graph of a triangle. In this same script I have another class called "Circle" that has a method called...
asked by 20.11.2017 / 03:09
3
answers

Process character string with while loop

Someone could explain the logic of this exercise is not very clear to me It's about entering an email and checking if it has the "@" character mail=input("Ingrese un email") cantidad=0 x=0 while x<len(mail): #<-Esto no me queda claro...
asked by 01.05.2018 / 12:19
1
answer

How could I write this without getting a syntax error? [closed]

I am trying to calculate numbers in a range that when divided between 2 3 4 5 and 6, give rest 1 2 3 4 and 5, respectively. The syntax error is found when trying to use the module and match it to the rest that I want to obtain. n = 0 while n...
asked by 16.05.2018 / 22:59
2
answers

Add elements contained in a Python dictionary

I need to create a dictionary that has the sum of elements of another dictionary, in the most computationally efficient way. The main dictionary is of the form: {'11': [0.76700000000000002, 3455.0, 0.76700000000000002, 0.76700000000000002,...
asked by 18.07.2017 / 14:17
4
answers

Python TypeError: 'int' object is not callable

Help why I get that error # -*- coding: cp1252 -*- import math a = input("Ingrese a ") b = input("Ingrese a ") c = input("Ingrese a ") s = (a+b+c)/2 if a+b >= c: raiz = math.sqrt(s(s-a)*(s-b)*(s-c)) p...
asked by 11.03.2018 / 20:25
1
answer

Django Validate Forms

I'm trying to make a form to store company information, so far it works perfectly when it saves to database etc. I am using forms.Form the detail is that in a template I am not using {% forms.as_p%} if not each one separately in order to make...
asked by 24.10.2016 / 02:14