Questions tagged as 'python'

1
answer

Concatenate time Django

I have a project in django where I have the fields hour, minutes, seconds separately I need to concatenate them so that they remain in the format "% H:% M:% S" direferencia=6243.0 #Este valor esta en segundos hora=math.floor(diferencia/36...
asked by 13.08.2016 / 04:55
1
answer

add hours in Django models

I am trying to make a movie model in Django, but I would like to add the duration of it and I do not know how to do it very well in django, I know that you can add date and time with datetime in the models. But I only want an hour of dura...
asked by 15.08.2016 / 15:17
1
answer

Add new element to Python dictionary

I want to add new elements to a dictionary in a for cycle, but it is replaced. I am adding it this way: for j in range(len(Repetidos)): historias[m[j]]=Repetidos[j] Is it okay how I do it? since at the end I only throw an ele...
asked by 13.07.2017 / 00:47
1
answer

Error between datetime.date and NoneType operations in Python

Bearing in mind that partidos is a list with sublists containing tuples. Ex: partidos = [[(datetime.date(2000, 9, 9), 'FC Barcelona', 2, 'Málaga CF', 1)], [(datetime.date(2000, 9, 9), 'RC Deportivo', 2, 'Athletic Club', 0)], [(datetime...
asked by 09.12.2018 / 12:18
1
answer

Define in which quartile values of a column are found

From a column that contains different numerical values called 'col6' I want to know for each sample in which quartile it is. To represent it I want to have 4 columns and do it in a binary way. What I had thought is to create 4 columns o...
asked by 14.12.2018 / 13:51
2
answers

Remote access to my home computer

Actually I have tried from my tablet to compile code in python, I can do it from home using OpenSSH to my Linux team and also access my console, I would like to be able to access in the same way outside my local network. If possible making us...
asked by 21.11.2018 / 20:42
2
answers

How to make it only admit integer response?

Hello, I'm new to python and I wanted to ask you how to make a variable that only admits whole numbers in response to what I mean: In C: int numero; printf("Ingrese un numero: "); fflush(stdin); scanf("%i",&numero); printf("El numero in...
asked by 26.12.2018 / 06:11
2
answers

Cycle problem in Python

I have this approach:    Read 10 whole numbers, store them in a list and determine   how many numbers of those stored in that list end in 15 I have this code, but I do not know where it is that I am wrong; For more than I look, I do not k...
asked by 06.10.2018 / 18:45
1
answer

IndexError: list assignment index out of range with lists and input (). split ()

I'm trying to make a program in which the user has to enter a character and then assign it the value, and I want the character and value to be on the same line separated by a space, so I'm using input () .split () to separate it into 2 different...
asked by 06.10.2018 / 03:22
1
answer

Filter by fields of the same model

I need to know how I can filter in a model that is an Invoice where I have two fields to pay and another that is paid, I have to do a filter to get the bills that have different amounts than paid to know which of the bills are unpaid. class Fa...
asked by 29.08.2018 / 15:16