Questions tagged as 'python'

2
answers

How to find the most common value inside each column of an array using python?

I have an array (3 x 3280), I need to traverse each column and consequently each row and find the most frequent value and thus generate another vector (1 x 3280) with those values. For example: matriz=[1 2 3 4 ....],[2 3 4 5....],[1 2 4 4...]]...
asked by 01.06.2018 / 17:59
0
answers

Cache Storage with Python

I'm trying to use WPA in a Flask application. I would like to know if it is possible with Flask or Python itself to store my pages in the browser's Cache Storage? From what I've seen so far I'll have to use javascript, but I'm trying to avoid...
asked by 31.05.2018 / 01:24
0
answers

save value of a tkinter button

Basically, I generate buttons within a for that runs through a dictionary, as the dictionary size varies with each search. for a in resultados: id = a['id'] btnDetails = Button(self.label1, text=a['nome'], command=lambda : self...
asked by 31.05.2018 / 04:01
0
answers

Generate histogram in django

Hello, I've been trying to generate a histogram in django for a project I'm developing. The code usually generates the histogram without difficulty the first time, however, when I try again, it returns me the following error "RuntimeError: main...
asked by 04.06.2018 / 16:09
0
answers

PasswordResetView does not send email

I'm doing a project where I'm using the Views based on Django classes. More specifically, I'm using Views to reset my password. Here are my codes: # View de exibição do formulário class passwordResetView(PasswordResetView):...
asked by 29.05.2018 / 23:07
0
answers

I would like to test with pytest in this code

I am new to python and pytest the following code and a simple chatbot, but what I would like to know and if you give it to test everything up to the interface or the only function, and how should I create the test code for this function def ve...
asked by 30.05.2018 / 15:32
1
answer

how to get data from outside and add in an existing function in Python

I'm creating a little game of dice but when I want to put a dot of points I'm not getting ... def get_dados(): dado1 = int(input("Digite o número para o primeiro dado: ")) dado2 = int(input("Digite o número para o segundo dado: ")) retur...
asked by 27.05.2018 / 22:37
0
answers

Render html file in template in django

I have a class in Django that models a Post and would like to allow a user to upload a file but how do I render that file in the django template ??? class Article(DateAbstractModel): 'Modelo de um artigo do site' name = models.CharFi...
asked by 26.05.2018 / 03:20
1
answer

Can you reference an enum within itself in Python?

I would like to use a constant that I created in one enum as an attribute of another, for example: from enum import Enum class Jokenpo(Enum): PEDRA = ('Rock', [Jokenpo.PAPEL], [Jokenpo.TESOURA]) PAPEL = ('Paper', [Jokenpo.TESOURA], [...
asked by 01.06.2018 / 04:08
0
answers

How do I get the values of each key in a json tweepy (Status) file?

I have a file inside that the following structure exists, is there a way to access a specific key? For example, I want to get and print the "id_str" (10228272). Each new line (information about tweet) in the file starts with this "Status". Sta...
asked by 30.05.2018 / 23:08