Questions tagged as 'python'

1
answer

How does Python interpret multiple comparison operators? [duplicate]

I have found the following using a Python REPL: 3 == 3 > 2 => True At first I thought it might be something related to operator precedence, however: 3 == (3 > 2) => False (3 == 3) > 2 => False How does this work the...
asked by 09.06.2015 / 16:11
1
answer

Error trying to install yowsup: Unable to find vcvarsall.bat

I'm trying to install an application that registers mobile phones in WhatsApp . I tried using the command below: python setup.py install And the following error occurs:    error: Setup script exited with error: Microsoft Visual C ++ 10....
asked by 03.05.2015 / 06:38
1
answer

Information contained in two pages Scrapy

I'm not a python programmer, but I'm trying to work with the Scrapy application. The above example is what I need, this runs in chrome extension. To explain, I need the post and all information available. In the case of the Post, the...
asked by 14.05.2016 / 00:39
1
answer

How to stop a loop using the input provided by the user?

I am writing a program that receives entries and creates a dictionary from them. I need the loop that I use to insert the entries in the dictionary to be broken when the entry is "9999", but it is not working. I'm doing this: dic = dict () dic...
asked by 17.04.2016 / 15:27
1
answer

How to calculate the second totals in a date range list by ignoring intersections of intervals in Python?

I'm trying to calculate the total time in a list of date ranges in Python, and if there is an intersection between the ranges, it should merge to be calculated as if it were a new range. Interval 1: intervalos = [ {'inicio': datetime(20...
asked by 26.11.2014 / 20:54
1
answer

Sublime Text 2 build gives a different result from iPython on the command line

I'm trying to migrate to Sublime Text 2 and do everything without leaving the program. Before I ran a script with the following line: from scipy.stats import beta, bernoulli, gaussian_kde No shell within iPithon the command ru...
asked by 08.03.2014 / 17:55
1
answer

Sort dictionary and add python values

I have this text file that is processed to capitalize and this part does it correctly. olá meu nome é meu nome pois eu olá é meu nome walt não disney olá Then I have this function that should be able to calculate the frequency of each word...
asked by 15.12.2018 / 17:35
2
answers

Retrieve list written to file with Python

I would like to go to my file that contains the following ['teste1', '27-12-18', '12/5/2015', 'Aberta'] ['teste2', '27-12-18', '6/7/7', 'Aberta'] ['teste3', '27-12-18', '12/5/6', 'Fechada'] and only show if the 3 field is Open I have the fo...
asked by 27.12.2018 / 17:19
2
answers

Find out if a timedelta object has any negative attributes

I have a function that takes a parameter of type timedelta . I'm looking for ways to know if the object passed by parameter has any of its (days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0) negative att...
asked by 29.12.2018 / 12:52
1
answer

How to associate a set of words to a "do_" method of class Cmd?

I'm using the Cmd class of Python's cmd module to create an interpreter for a game in Text Adventure. However, I came up with a problem regarding the words I use as methods for the interpreter to execute. See this example example:...
asked by 17.10.2018 / 04:34