Questions tagged as 'python-2.7'

2
answers

How does Python maintain the same memory reference of a list after resizing it?

We know that objects of type list , because they are based on dynamic vectors, have a maximum internal capacity. We also know that when full capacity is reached and we want to insert a new value into the list, Python allocates a new array...
asked by 10.10.2017 / 17:10
2
answers

input () and raw_input ()

According to the Python 2.x documentation, it is recommended to use the raw_input function instead of input . Conversely, in the Python 3.x documentation, the raw_input function does not even appear. So does the input...
asked by 08.08.2016 / 01:07
2
answers

Extracting Window Values and Schedules in a Network Dump

The following network dump (PCAP file format) results from the capture of a denial of service attack in the lab: I would like to extract the time (unix time) and window value (win) and save it to a text file in the following format:...
asked by 28.05.2017 / 07:10
1
answer

What's wrong with this Python code?

I'm trying to create a simple project for study purposes but I'm having trouble completing it. I am using the Pytube library to download videos, I can download the videos but I can not show the download progress bar and the size of the file (v...
asked by 21.04.2017 / 16:30
2
answers

List of square roots

How can I make a function that receives a n parameter, which returns a list of the first% of% square roots using higher order functions in Python. As shown below: [sqrt(1), sqrt(1)+sqrt(2), sqrt(1)+sqrt(2)+sqrt(3), ...] I've tried...
asked by 08.04.2017 / 22:08
2
answers

Difference between dates / times in Python

I need to calculate the difference between two dates in python, but always some error. >>> from datetime import datetime >>> data1 = datetime(2015, 8, 5, 8, 12, 23) >>> data2 = datetime(2015, 8, 9, 6, 13, 23) >>...
asked by 13.08.2015 / 21:10
2
answers

Get X and Y from the screen using PYTHON

I want to create a bot (macro) that performs some click tasks, so I'm using pyautogui in python ! But I do not have much experience with X and Y, and I'm testing it manually and boring. I would like to get the x and y by clicking on the...
asked by 23.10.2017 / 02:54
1
answer

Display only hours, minutes, and seconds on a chart whose entry is in unix time

Be the Python code that generates a bar chart: # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import matplotlib.dates as dates from datetime import datetime, timedelta x = [] y = [] with open("dados.csv") as f: for l in f:...
asked by 03.09.2017 / 19:37
1
answer

Bar chart made in Python was "weird". Any suggestions on how to improve it?

Friends, The following graphic was generated: Thecodeusedwasasfollows:#-*-coding:utf-8-*-importmatplotlib.pyplotaspltimportmatplotlib.datesasdatesfromdatetimeimportdatetime,timedeltax=[]y=[]withopen("dataset_semAtaques__10Abril2017_1min.c...
asked by 22.08.2017 / 16:54
1
answer

How to know which libraries are being used in a python project?

I made an installation of an application made in Python, it basically works as follows, it installs the Python program and in the end the installation copies the folder with the libraries for the Python installation. Everything works perfectl...
asked by 02.10.2017 / 20:26