Questions tagged as 'python-2.7'

1
answer

Problem with relative links in Scrapy [closed]

I want to raise the complete news of the links that appear on the cover of an informative site. But the links are relative The site is link And the links look like this <div class="article-title"> <a href="/v2/arti...
asked by 09.07.2016 / 23:26
3
answers

How to capture parameters sent by the GET method?

This is the way I use but I do not get to capture the parameter in the controller enters the else but does not capture: def get(self, request, *args, **kwargs): if request.method=='POST': print "rrr" * 99 else:...
asked by 18.05.2016 / 23:04
2
answers

Replace commas with points in a dataframe (comma as decimal separator)

I'm new to pandas and I have a question about changing points by commas in Python 2. The numbers in the csv are presented this way: As you can see in the image, the floats have different number of decimals. First I tried to change...
asked by 22.07.2018 / 04:07
0
answers

Error sending form in Mechanize

I am trying to autocomplete a form but I submit an error. I show my code explained by parts: import mechanize import cookielib import ssl ssl._create_default_https_context = ssl._create_unverified_context br = mechanize.Browser() cj = coo...
asked by 24.01.2018 / 01:04
2
answers

Sum of dictionaries

I'm working with python and django and I have several data dictionaries that I want to add up for a total. All dictionaries can have two keys primera and segunda , but I must get a total of both primera and segunda...
asked by 05.01.2018 / 00:06
3
answers

Arguments sys.argv [1] .split () as string?

I'm stuck in a script. I try to expose you to see if you can help me. I define the following before entering the loop. cliente, fecha, hora, state, nombre, result, most_repeated = sys.argv[1].split() timestamp = str(fecha)+' '+' '+str(hora...
asked by 09.01.2018 / 09:16
0
answers

Primary Python running Python files in a chain

I have a process developed step by step with three Python files. I want to make a main Python file that executes the Python files step by step. I've seen that I could do it with the following code: import commands result=commands.getoutput(...
asked by 06.04.2018 / 12:26
1
answer

Problems with URL in Django

I have an application in django that runs perfectly on the test server, but when it comes to deploying with the Mod_WSGI it gives me the following error http://localhost/ingresar?next=/Terry/ The requested URL / enter was not found on this...
asked by 02.03.2018 / 15:16
1
answer

Special characters in writing to Python files

I'm doing a python script to organize and count words from a text given by a file. I have the problem when printing it to another file. The code that prints the file is this: def printToFile(self, fileName): file_to_print = open(fileNam...
asked by 03.08.2017 / 20:05
1
answer

Python date concatenation in a query for mysql

I have the following mysql query. SELECT purchase.DATE, products.ID, products.NAME, purchase_details.UNITS, purchase.REFERENCE, purchase_details.PRICE,purchase.ID_PROVIDER FROM purchase INNER JOIN (products INNER JOIN purchase_details ON produ...
asked by 02.11.2016 / 18:43