Questions tagged as 'python'

1
answer

Sorting lists with multiple parameters using lambda expression

Given the Ponto class, the ordenar function sorts the list elements by following the following criteria: first value in x , then y and finally value in z . Beauty, the code works. But I would like to understan...
asked by 01.11.2017 / 00:18
3
answers

There is no library called math

Because when I import sqrt of the math bookstore it says that there is no bookstore called math , but still the code works? Does not give error works fine, but that underlies in math and sqrt . To "heal" while...
asked by 06.12.2017 / 05:00
2
answers

Youtube API V3 Information

Youtube has disabled API V2 and the new API (V3) is much more complicated to get information about videos. How can I get the following information from a video in the v3 API: Video title. Duration of the video (in seconds). How can I...
asked by 10.05.2015 / 21:44
2
answers

How to find, check and change file?

I have a doubt that I am new to python. I have a file for example: bla bla bla bla bla bla 5 bla bla bla 846:545 energia 3 I intend to read from the teste.txt file the energy information. Of which I want to check the number that is,...
asked by 29.06.2015 / 13:21
1
answer

What is the __new__ in python method used for?

class Fabrica(object): """ pra quê serve o metodo __new__ in python? """ def __new__(cls[, ...]): # seu codigo aqui #EOF What does she do, and how do you make use of it?     
asked by 22.01.2016 / 20:51
1
answer

Create a key / values association from user-entered data

8) Write an algorithm capable of receiving a variable amount of parameters that are associated with a key. Then print the key name and its value on the screen: def func_varios_parametros_dic(**dicionario): print(dicionario) lista_k = []...
asked by 22.11.2018 / 19:20
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

What's the difference between the MVC architecture and Django's MTV?

I would like to know if there is any difference in practice between these two architectures.     
asked by 17.10.2017 / 18:59
1
answer

How to normalize data? Any sklearn libbioteca?

I need to normalize data that I have to be between -1 and 1. I used StandardScaler, but the range got larger. What other sklearn library could I use? There are several in sklearn, but I could not, it should make life easier, but I do not t...
asked by 16.05.2018 / 00:03
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