Questions tagged as 'python'

2
answers

Format Date to Save Form

Good afternoon, I have a view based on Form View: class CrearPuesto(FormView): template_name = 'crear_puesto.html' form_class = PuestoForm success_url = reverse_lazy('administracion:maestro_puestos') def form_valid(self, form)...
asked by 04.05.2016 / 22:28
2
answers

CMD executes tasks in a separate window, how to do it so that it can be executed again in the main window?

Working with Django in the CMD suddenly now executes all the processes in a separate window causing several inconveniences. I need you to do them again in the original window as you always did.  I chose to illustrate the case the typical "manag...
asked by 28.06.2016 / 11:00
0
answers

How to call a zeep python service?

I'm trying to connect to a SOAP service with the Zeep library. I have a function that mocks the data and makes the call: def cotizacionGuia(self,valor_declarado): wsdl = 'https://redservipruebas.almalogix.com/distribucion/webservices/ws...
asked by 28.03.2018 / 12:26
1
answer

Obtain opposite polynomial

I know it can be silly but I can not find how to do it. I want to know how I can calculate the opposite polynomial created in Numpy regardless of its degree . Example that does not work for me: import numpy as np p0 = np.poly1d([2., 0.,...
asked by 19.04.2016 / 21:22
2
answers

Working with python lists

I have the following list lista=[('1', '3', 0.29), ('1', '2', 0.36), ('1', '5', 0.32), ('1', '7', 0.19), ('0', '2', 0.26), ('0', '4', 0.38), ('0', '7', 0.16), ('0', '6', 0.58), ('3', '2', 0.17), ('3', '6', 0.52), ('2', '7'...
asked by 18.06.2017 / 01:50
3
answers

How to find the most repeated number in a list

I have the following list: [0, 1, 2, 3, 4, 6, 6, 17, 16, 9, 10, 23, 12, 13, 14, 15, 16, 17, 18, 4, 20, 4, 22, 23, 24, 4, 4] I wanted to know how to find the number with the most repetitions without having to use a cycle since I do not see i...
asked by 29.03.2018 / 19:17
1
answer

Function-Based Views (FBV) VS. Class Based Views (CBV)

When creating a project in Django, let's say, of relative complexity and size, I have always been inclined to use FBV since I find them easier to use. Some say that it is better to use CBV because they have some advantages such as the inheritanc...
asked by 02.12.2015 / 13:34
1
answer

How to implement a conf file using Python

I need to implement a configuration file of those used in Linux / Unix, to be able to access from a Python application. For example, given the file.txt file that contains: # Hora inicio hora_ini 14:00 # Hora final hora_fin 22:00 I need my...
asked by 10.02.2016 / 17:09
1
answer

matrix edition

I am writing a program that I read a matrix and if the value of the element is less than a value rewrite it as zero and if it is greater than the value, leave it as such. I do this: lis=open('ej.txt','r') A=lis.read() A=np.genfromtxt(StringIO(...
asked by 23.08.2016 / 02:05
1
answer

Can you draw rectangles of Riemann sums with Python 3?

I already drew the graph of the equation x ** 2 with Jupyter with the code: from sympy.plotting import plot from sympy.abc import x eq=x**2 plot(eq,(x,-2,2),ylim=(-1,2),line_color="g") that gives us the image: but it is also necess...
asked by 16.10.2016 / 08:07