Questions tagged as 'python-3.x'

1
answer

how to clean request.POST? Django

I am doing a card payment process. When making the confirmation of the transaction I want to be able to delete the POST data so that I can not make a new transaction when reloading the page. My code is this: def comprar(request,producto,sto...
asked by 12.04.2018 / 11:59
0
answers

Apply visual effect on matploitlib

How can I change the style or visual aspect of a graphic made in specific matplotlib this: import wave import struct import sys import numpy as np from math import sqrt import matplotlib matplotlib.use('Agg') from matplotlib import pylab impor...
asked by 31.03.2018 / 22:12
0
answers

Download flat files within a directory of an ftp0 server with ftplib

I need to download the files stored inside a directory of a public ftp0 server, to later be able to generate a table with data extracted from them. I've tried with various programs taken out of ftplib but I get an error: import sys i...
asked by 03.04.2018 / 13:18
1
answer

Add row at the end that adds totals of columns in POSTGRESQL

I have the following query, in postgresql and psycopg2: cur.execute("""select admin_eps.nombre_eps, admin_eps.nit_eps, SUM(COALESCE((sbmEmp/30*diastmes + sbmEmp/240*1.25*hon + sbmEmp/240*1.25*hed + sb...
asked by 29.03.2018 / 23:10
1
answer

No module named 'encodings' in python

I have a server with Centos 7 and ps I'm working with python, I need to install a module with pip3 but whenever I'm going to execute it I get the following error: Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError...
asked by 03.04.2018 / 21:55
1
answer

matplotlib and tkinter to plot in real time

I am trying to graph a series of data from a text file, but my idea is that this graph only appears when I press a button on a GUI made in tkinter. However, at the moment of pressing the button the graph appears but without the data, that is, it...
asked by 27.03.2018 / 20:24
1
answer

Error matplotlib.pyplot spectrogram

I'm doing an audio spectrum analyzer in python, however I run into 2 problems. 1.- It does not read the information of mp3 files. 2.- When I change the file that it receives for a file of 2 audio channels it throws me an error. This is my...
asked by 24.03.2018 / 18:03
1
answer

How to create and read yaml files in python?

I understand that in python to be more ordered, .yaml files are used. The problem is that I do not know how to read or create them. Can someone help me?     
asked by 31.03.2018 / 04:39
0
answers

Limit the entries in the models.ForeignKey ()

Is it possible to limit the entries in models.ForeignKey () to an exact amount? I have a model called a Card that belongs to a Profile, I want each profile to have a maximum of 2 cards. class Tarjeta(models.Model): perfil = models.OneTo...
asked by 22.03.2018 / 17:47
0
answers

how to run a Python script from Wordpress

Hello everyone and thanks in advance. I'm pretty new to Python and for now I'm just taking my first steps doing web scrappers and networking tools. The problem: I have a web scrapper that works wonders from the Idle. Now, I have to use it fro...
asked by 21.03.2018 / 15:21