Questions tagged as 'python'

0
answers

Python I can not import ReCaptchaField

There is a project that has been sent to me on which I will work on it. I created an environment to upload the project and in design I had the requeriments where I circled it. But when I run the command python manager.py runserver it is g...
asked by 01.11.2016 / 21:04
1
answer

OAuth v2 in Django 1.4

Friends, I'm studying how to implement the OAuth v2 protocol in my application. I've researched a lot here and found nothing that could solve my problem. So far I have a database in PostgreSQL and authentication with a Django middleware. I've...
asked by 11.11.2016 / 19:55
1
answer

Create Views in the Database from Role

I'm developing a simple application where you'll need to create a PostgreSQL view via Python function. So far it seems like a simple code, but what I did it does not create views in the database and also does not present an error to my de...
asked by 16.10.2016 / 17:18
1
answer

How to convert str to unicode python

I have to do a comparison between 2 items, one is in unicode, and the other is in str, and what is str is an array. for bloqueiosPermanentes in arquivo: self.blocks.append(bloqueiosPermanentes.replace("\n", "")) This is how append is ma...
asked by 19.10.2016 / 16:35
1
answer

How to return multiple values in a function in python?

I'm developing an API in Python FLASK and I need to show the result of a SELECT I made via SQL ALCHEMY . But when I use return it only returns the first ROW of SELECT . The funny thing is that with "print" it...
asked by 17.11.2016 / 17:39
1
answer

Dynamic table in python

I have a problem and I can not identify the error. I am creating a Python PivotTable where it will be populated with database information. The problem is the code is repeating the first line of the sql query: # Cria tabela def tabela(self,l...
asked by 22.10.2016 / 00:57
0
answers

Add CLASS attribute in Option of select widget django

I'm using widget=forms.Select() in a forms.Form of Django, however, when trying to add a CLASS attribute in Options, which is part of Select, I can not, just in Select itself, I've been looking for and only found Override options o...
asked by 06.10.2016 / 16:51
1
answer

Code in Python locking in time (Running in Rasbian)

I made a code in python, but it hangs after a while running, can anyone help me to optimize it so it does not crash? #!/usr/bin/env python #-*- coding:utf-8 -*- import serial import time locations=['/dev/ttyACM0'] while 1: arquivo =...
asked by 30.08.2016 / 21:06
1
answer

Change width and height of Excel cell using xlwt

I need to change height and cell width of Excel I'm using the xlwt library. I did not find any references, can anyone help me?     
asked by 21.09.2016 / 22:19
0
answers

How to write a schema of type List in python Eve

Hello. I'm writing a schema and I need to understand how to make a list using Python Eve and cerberus . I am currently writing how the documentation teaches me: 'datasources': {'type': 'list', 'schema':{'type':'string'}} But when...
asked by 27.10.2016 / 13:44