Questions tagged as 'python'

1
answer

Problem in class dict and joining large amount of elements per dict in Python

Hello, I'm having problems with dict . I have two lists: lista1 and lista2 , both of the same size. When I run the command: dicionario = dict(zip(lista1, lista2)) produces a dictionary "smaller" than the size of the lis...
asked by 17.07.2016 / 08:08
1
answer

Solve duplicate items in dict in Python 3

I'm having problems with my dict . I need it not to delete the duplicate key values. I have a tuple style lista_tupla = [(1, [1, 2, 3, 4]), (2, [5, 6, 7]), (3, [7, 8, 9]), (3, [10, 11, 12]), (4, [13, 14, 15])] but when I use the...
asked by 17.07.2016 / 17:47
1
answer

Problem with dicts and zip in Python 3 [duplicate]

I am having problems with the dict(zip(x, y)) function when I pass the two lists as a parameter ( x and y ) zip does not create the original size list, randomly creates the list in its original size, but most always...
asked by 17.07.2016 / 05:31
1
answer

Python Help in Object Orientation

What's wrong with this code? The compiler points to error in line 8 ... class Pai(object): Nome='Carlos' Sobrenome='Maria' Residencia='Rio de Janeiro' class Filha(Pai): Nome='Luciana' def __init__(self, humor): self...
asked by 17.05.2016 / 00:19
1
answer

Rounding Up

I have the following list of dictionaries and the values correspond to the average value, for example, in the 1st appears 4, but in fact of 4,6666. I would like to know how and what to do, I have already tried the round, but it stays the same....
asked by 26.04.2016 / 14:36
0
answers

Server 500 error reverse openshif with django

I deployed an application in openshift and basically the same is a crud, what happens, whenever I try to register a new client the server returns me "server error 500", can someone tell me why this error? , I'm finding that the problem may be du...
asked by 03.05.2016 / 02:28
1
answer

How to print page

I want to create a template for printing data but I'm kind of lost in how to do this, I have a print name button, it's in a table that contains the customer's name, phone number, in it it should take the id of this client and the data of the sam...
asked by 10.05.2016 / 00:52
1
answer

problem with existence condition in while python. turtle

I'm having trouble solving an exercise in a programming book. The exercise asks that I create 2 turtles and move them randomly, so that each turtle walks 50 units forward, then turn either to the left or to the right, 90 degrees. Turtles shou...
asked by 20.04.2016 / 05:54
2
answers

Dictionaries for Dictionaries List

I have a dictionary like the following: {'Eva': [4], 'Ana': [53], 'Ada': [12]} And I want to turn it into a list of dictionaries in this type: [{'Nome do Dono': 'Eva', 'Media de idades' : '4'},{'Nome do Dono':'Ana':'Media das Idades':'53'...
asked by 25.04.2016 / 16:13
1
answer

How to run an .exe program in the background using python script?

I'm working with the arcgis program that reads python language. I already loaded it in the arcgis python scripts and I need in the background to run a program called gams .. For this I needed to create a python script, to add to the others, that...
asked by 26.04.2016 / 18:37