Questions tagged as 'python'

1
answer

Avoid getting Favicon in Flask

I have a client-server application in Flask, and when I do a get to the server, another get is done by asking the favicon of the address. I would like to know if you can not automatically get this favicon get.     
asked by 19.09.2017 / 21:47
0
answers

Send Functions using pickle and use LOOP

We are developing an application with client-server structure using the socket and pickle library, we need a loop that continuously sends the data to the client using the pickle to compress the data of the functions and send. but the loop only w...
asked by 19.09.2017 / 16:36
1
answer

How to save information equal to pprint in a txt file

I'm creating a function to generate a log file: def setLog(msg): file = open(nome_arquivo, adicionar_informacao) if type(msg) == str: msg_log = msg.encode('utf-8'); else: try: msg_log = str(msg).encode('...
asked by 22.09.2017 / 16:22
0
answers

Message Value error

Good afternoon, I got an error message from operands coul not be broadcast together with shapes (256,) (268,) the image shows the error Thecodeisasfollows:importRPi.GPIOasGPIOfromlib_nrf24importNRF24importtimeimportspidevimportmathimportstringi...
asked by 28.09.2017 / 16:04
0
answers

Error converting from matlab to python

I want to convert the following function into matlab for python: Função Matlab cn = reshape(repmat(sn, n_rep, 1), 1,[]); resultado matlab cn = Columns 1 through 23 1 1 1 1 1 1 0 0 0 1 1 1...
asked by 06.10.2017 / 15:24
1
answer

TypeError: only length-1 arrays can be converted to Python scalars

Good afternoon. I made a small algorithm in Python , the following error appeared:    TypeError: only length-1 arrays can be converted to Python scalars. Someone could help me. Follow the code. import numpy as np import math x=np....
asked by 06.10.2017 / 17:14
1
answer

Error in Python2

I'm practicing using Python 2, but I do not know the reason for this error. Below is my code with the error. And numpy and scipy are installed, because when I give the import no more error appears. vaca1= [1,1,0] vaca2= [1,1,0] v...
asked by 15.09.2017 / 04:43
1
answer

How to isolate metadata with pdfminer?

I wrote this code in Python 3 to read the metadata of a PDF: >>> from pdfminer.pdfparser import PDFParser >>> from pdfminer.pdfdocument import PDFDocument >>> fp = open('EMC 1-2017 PL678716 =- PL 6787-2016.pdf', 'rb'...
asked by 15.09.2017 / 13:24
1
answer

Get data in Django view

At the time of registering a new user, he chooses which group is part of a select. Each group has a responsible person, how do I get the email from this person to send an authorization request email? In this code I send email but to the email...
asked by 14.09.2017 / 15:27
0
answers

How to download a file with Python?

This site has several links that open PDFs, in the "Full content" locations: link In Python 3 I wrote this code to try to download a link: import urllib.request, urllib.parse, urllib.error url = "http://www.camara.gov.br/proposicoesWeb/pr...
asked by 14.09.2017 / 01:31