Questions tagged as 'python-2.7'

1
answer

Grouping of groupby pandas table

I have a table in this format User Material Nota 1 youtube 5 2 facebook 4 3 facebook 3 4 facebook 5 6 youtube 2 7 orkut 3 8 twitter 4 and would like to group so that in th...
asked by 17.07.2018 / 17:10
2
answers

Permutations and files

I'm working on a joke that involves permutations, to create a list of words, in several separate files. Problems start appearing when words with more than 4 letters are required, because the corresponding file becomes too heavy. What I wanted wa...
asked by 14.03.2015 / 10:15
1
answer

Django - How does the @login_required decorator work in the views of another app?

I have a project in Django and only an application where I make registrations, searches, login to the system, etc. I was reading an article on the creation of projects and I saw that because of organization it is normal to have several applicati...
asked by 26.05.2014 / 18:22
1
answer

Robo_feed check loop routine if giving stick in python

Robo_Feed I am new to python, I was trying to develop a theft that took the last post from some news portals here in my region. With a search I came to the conclusion that it would be easier to do with the python feedparser module. So I'll try t...
asked by 16.01.2017 / 03:55
2
answers

How to create a counter in face detection?

As you can see in the code below, it only detects the faces with haar cascade, I would like to know how I can display the number of people currently detected on the webcam. from __future__ import print_function #importa a funcao da biblioteca...
asked by 03.06.2018 / 18:22
3
answers

How to start a Django project using virtualenv?

I have already tried and found different ways and different conventions for creating a project in Django using virtual environment (virtualenv). Is there any standard for this? Does anyone help me with a correct step by step? Using python 2.7...
asked by 15.09.2015 / 04:23
0
answers

Counting the number of IP connections to a web server on port 80. Is the regex correct?

I would like to count the number of connections per IP per second (on port 80) to a web server whose IP is 192.168.1.216. The entry for the count is a network dump file in the PCAP format (.pcap file) generated with tcpdump. The output will be d...
asked by 02.09.2017 / 17:42
2
answers

Generate random numbers in Python without repeating

I have the following situation: I have a vector with 4 indexes. At each index a random value of 0 to 100 is generated. I have a code that does it perfectly, but sometimes the numbers repeat. Below the code: from random import randint...
asked by 06.04.2017 / 04:28
1
answer

Python command subprocess.check_output

I'm calling a program in Java via Python's subprocess.check_output command. It's not working. In this command I pass a file as a parameter. Is there something wrong with the command below? import subprocess def chamaProg(arquivo):...
asked by 06.05.2015 / 14:53
2
answers

Python reserved word yield

What's the difference between the following codes? def bottom(): yield 42 def bottom(): return (yield 42)     
asked by 24.06.2018 / 06:14