Questions tagged as 'python'

1
answer

Requesting request get parameters from PagSeguro

I'm trying to integrate a Django app with PagSeguro, but I'm having trouble with the notifications part. This is the view that receives the notifications: def recebe_notificacao(request): if request.method == 'POST': notificat...
asked by 03.06.2014 / 11:59
2
answers

Attribute name for the secondary key in a template in Django

I have a problem with a database imported into Django 1.6.5. In this database the columns follow the pattern: id_city, name, id_state, and so on. But django did not handle it well and I left the class like this: class City(models.Model): i...
asked by 04.06.2014 / 02:27
1
answer

Fortran code adaptation for python [RuntimeWarning: overflow encountered in double_scalars]

I tried to adapt the following code in fortran for python: PROGRAM Escape_tent IMPLICIT NONE ! Declare local variables INTEGER :: i,j,tfinal,P,k,rede Real,dimension(0:2800) :: x,xn real, external :: f Real :: sigma,pi,soma,r pi=4.*atan(1.0) !...
asked by 30.12.2018 / 20:08
1
answer

Is it possible to install Python on Windows 10 without admin privileges?

I have Python 3 installed, but the default installation was done in the program files folder. And I work on a machine with a user profile, with rigid rules of proxy, etc that have already caused a lot of delay here. My real problem is that wh...
asked by 27.12.2018 / 14:10
1
answer

Warning pandas, 2 loopings!

I have a problem with this looping, because it is a situation that I can not solve with np.where , why have to run DataFrame to find the value of the gain or loss from another condition, whichever comes first . It's working but I...
asked by 22.12.2018 / 02:16
1
answer

Creation of flask-sqlalchemy tables

I'm developing a small application in Flask and I'm using the Flask-SQLAlchemy, Flask-Migrate, and Flask-Script extensions to manage my migrations in the database, following my application's configuration. # -*- coding: utf-8 -*- from flask i...
asked by 22.12.2018 / 04:04
1
answer

I'm trying to make Bhaskara in Python and even with the if highlighted the programming says that I can not transform a complex into float

a = float(input("A = ")) b = float(input("B = ")) c = float(input("C = ")) delta = float(b**2-4*a*c) raiz = (delta ** 0.5) if raiz is float or int: raiz = float(delta ** 0.5) x1 = float((-b + raiz) / (a * 2)) x2 = float((-b - raiz) /...
asked by 21.12.2018 / 20:40
1
answer

How to configure SublimeREPL for Anaconda (Python)?

I installed the SublimeREPL for run the line or the selection directly from Sublime Text 2 . However, In the same way as in this previous problem , SublimeREPL is not using Anaconda but rather another version of Python. How to configure Sublim...
asked by 09.03.2014 / 17:49
1
answer

Deploy Python project in heroku with error

I am trying to deploy a Python project using Django in Heroku. The deploy all goes well, but when trying to heroku run python manage.py migrate the following error occurs. Traceback (most recent call last): File "manage.py", line 23, in...
asked by 14.12.2018 / 02:07
0
answers

Error recording audio using pyaudio - IOError: [Errno -9997]

I'm trying to write an audio from a script I developed with python using pyaudio but I'm encountering a strange error, below is the script that was saved with the name rec.py: import pyaudio import wave import sys CHUNK = 1024 FORMAT = pyaudi...
asked by 13.12.2018 / 22:09