Questions tagged as 'python-3.x'

2
answers

Problems trying to create a virtual environment with pipenv

I'm having trouble creating a virtual environment with pipenv , I installed it without problems with pip , the problem happens when creating the environment. > I'm using Windows 10 and Python 3.7. I tried to install pipenv using the comma...
asked by 05.12.2018 / 16:12
2
answers

Is there any way to connect Python to a Websocket as if it were a client?

Modern browsers have the Websocket object, which allows you to connect to a Websocket server, allowing real-time communication. My question is: Is there a library in Python that would allow me to connect to a Websocket, receiving a...
asked by 17.08.2018 / 16:10
1
answer

Little doubt with numerical operations

I was doing a function in python that returns me the results (x 'ex) of the bhaskara formula, just to train the logic a little bit. more, but it made me curious. If I raise a negative number squared, the expected result is positive, right?...
asked by 14.04.2015 / 18:16
1
answer

Open multiple files with "with open"

You can open more than one file in a program with with open("meutexto.txt", "r") as f: I did not find anything about it (or did not look right). I know you can do it differently: var = open("meutexto.txt", "r") var_dois = open("meu_segund...
asked by 04.09.2017 / 11:55
1
answer

How to make a parallel system call in python?

I want to run a program parallel to mine, in case it is called download.py , it should run independently of my main main.py execution, but it should be called in it. I thought about calling systems and I'm using subprocess , a...
asked by 04.09.2018 / 18:04
1
answer

Showing total connections to a certain IP address

I have a network dump (PCAP file) containing slowloris attacks. The following script will show the number of connections to IP 192.168.1.2 on port 80: /usr/sbin/tcpdump -anr myfile.pcap | sed 's/^.*IP \([^:]*\)192.168.1.2.80:.*//p;d' |...
asked by 15.05.2017 / 03:03
2
answers

How to print a vector of integers by removing the last comma in Python 3?

I want to print on the screen a vector of integers on the same line and separated by commas, and I want to remove the comma after the last number. How could I do this in Python? My code looks like this: for i in range(12): print(nume...
asked by 22.05.2017 / 17:44
1
answer

How to create a reliable .desktop file in Linux?

I have the following .desktop file to open a file in Python , it is working, but every time before running it opens a dialog saying that the application launcher is not trustworthy, as shown below: / p> Desktop File: [Desktop Ent...
asked by 08.02.2018 / 16:46
1
answer

Error with requests with scrapy

I have a csv file with some urls that need to be accessed. http://www.icarros.com.br/Audi, Audi http://www.icarros.com.br/Fiat, Fiat http://www.icarros.com.br/Chevrolet, Chevrolet I have a spider to do all the requirments. import scrapy i...
asked by 09.09.2016 / 15:19
2
answers

Make word search within a list and return ordered tuples in PYTHON

The algorithm should receive a string, count as many words as possible, and return a list of tuples with the words that appear the most in the string and how often it appears. The problem is that in searches are words that start out the same cou...
asked by 05.11.2016 / 12:01