Questions tagged as 'python'

1
answer

PYTHON Formation

Can you give me a hint how to print the following problem in the right way? while True: m = int(input()) mlen = m sm = 1 aux = 1 matriz = [] if m == 0: print() break for i in range(m): linh...
asked by 19.06.2018 / 03:02
1
answer

Importing packages into tests with python

I have a project with the following structure: __init__.py setup.py - convert_keys/ - __init__.py - convert.py - tests/ - test_convert_keys.py Within my tests file I tried to import as follows; from convert_keys imp...
asked by 16.06.2018 / 22:15
1
answer

Try-except, IndexError, Alternatives to solve the error

I have a college job to do, in a way I finished it, but with some gambiarras that I wanted to straighten out and leave the code less confusing and etc. How the program works: Basically it creates a 600x400 screen with a% w of% number of ba...
asked by 23.06.2018 / 05:55
2
answers

Find the index in a vector of dictionaries based on the value

If I have an array of dictionaries and want to find the index in the array of a certain dictionary value, how do I do it? Ex: palavra1 = {'palavra': 'valor1'} palavra2 = {'palavra': 'valor2'} palavras = [palavra1, palavra2] If I want to...
asked by 14.06.2018 / 23:22
0
answers

Problem starting project with Fiona in Windows

I made a software in ubuntu, and I'm having several problems to run the same in windows what I'm working on now is to install fiona. I have it installed in my PIP packages but for some reason it does not work, so I decided to install it via s...
asked by 15.06.2018 / 03:54
0
answers

As the pandas reads timestamp data and converts to HDF5 (HDF5)

I am creating a C # application that generates a hdf5 document in which one of the columns in the dataset is a timestamp (using unix), and I would like this file to be read by the pandas so that it reads the timestamp as a datetime64 (which is t...
asked by 14.06.2018 / 20:07
1
answer

Calling Class Methods in Python

I'm doing a play of a game of cards and I'm having a problem calling the methods of class Deck() , I've tried to redo some parts of the code and sometimes as an undefined object, I re-do it again and still nothing, could someone help me if...
asked by 14.06.2018 / 02:26
0
answers

Function being called before being called by the GUI

I have software that I'm using Tkinter as a GUI, to get some parameters that the user will give me. In this software I have 1 problem and one question. The problem is this, as soon as I run the software, the process_files function is alrea...
asked by 14.06.2018 / 03:09
1
answer

Login 2.0 Django, authentication

I'm trying to make a login page, but I'm having some difficulties. For some reason I can not understand, every time I type the user and the password, whether it is right or not, it gives the answer that the user does not exist. My data base i...
asked by 19.06.2018 / 13:18
1
answer

Calculate the arithmetic mean of a vector

import numpy as np matriz = [] medias = [] alunos=1 while True: print("Informe o número do aluno ou um valor negativo para terminar:") valor=int(input('Digite o número do aluno: ')) if valor<0: break else: a...
asked by 12.06.2018 / 21:20