Questions tagged as 'python'

0
answers

problem with functions in python

Friends I have a problem with this code can help me always tell me that counter is 0 and therefore tells me that the digit is not in the vector this is my code: #-*coding:utf-8-*- ''' Construir una función que reciba como parámetros un vector...
asked by 22.11.2018 / 22:05
0
answers

Validate strings in an iteration - simulation production process - python

This is a simulator of a line of manufacture of an article. The production line has a process of arrival, painting and assembly, it also has a timeline in minutes. In the arrival process, I generate a random number and assign a probability tha...
asked by 21.11.2018 / 02:55
5
answers

How to kill a while loop True with the enter key

How can I end a while while True cycle using a line break? I have this little function: def number_add(): print("3[1;33m"+"Please enter two numbers: \n" + "3[;36m"+ "Operator 1: ", end='') a = input() print("3[;36m"+"Operator 2: ",...
asked by 21.11.2018 / 04:13
0
answers

How can I pass the id of a product from a template to another template in django?

I am working on a project in django and I have the following problem I have a list of products in a table, which belong to a common list (list with id 26), as seen in the following image: Now I need that when you click on the "add produ...
asked by 01.12.2018 / 11:45
0
answers

IndexError: list index out of range when compiling

file = open("csv_data.txt","r") lines = file.readlines() file.close() lines=[line.strip() for line in lines[1:]] for line in lines: person_data = line.split(",") name = person_data[0] age = person_data[1] university = person_dat...
asked by 23.11.2018 / 03:28
1
answer

Show and hide text in a Button Tkinter

I'm trying to place a button with tkinter that does not appear its text placed on it until you click on it. I am trying to do it in the following way but it does not work for me the buttons come out the same in white. I have doubts in the functi...
asked by 21.11.2018 / 14:24
0
answers

Generate blur effect in QmainWindow python

Good evening I would like you to help me put a blur effect in a window in pyqt the result that I hope is something like this: this is the code: import sys from PyQt5.QtWidgets import QMainWindow,QApplication, QGraphicsEffect,QGraphics...
asked by 25.11.2018 / 00:31
0
answers

how to change a boolean by clicking on an image with django?

I'm trying to change a Boolean value in my database by clicking on an image in Django I add my View, my Model and my html. View def reservacion(request): estatus = Asientos.objects.get(asiento=Aqui me gustaria colocar el valor del id del ht...
asked by 25.11.2018 / 00:23
0
answers

Group by 2 independent columns

I have a Dataset with millions of records that I want to group using pyspark by 2 independent columns, I'll give you an example: I have: ID Col A Col B 1 Alicia Madrid 2 Pepe Barcelona 3 Pepe Madrid 4 Juan Cadiz 5 Alicia Sev...
asked by 19.11.2018 / 17:02
1
answer

parsing a text file with python

I am new to the platform and to the world of python. I would like to be able to make a small script in which I give a file.txt, which contains a text string separated by | , and for each | that there is a line break (I understand it would be...
asked by 19.11.2018 / 18:13