Questions tagged as 'python'

1
answer

How to make the image take up 100% of the screen. pyqt5 -python

I have an image and I need it to occupy 100%, it will be the bottom of my program, how to proceed? from PyQt5 import QtWidgets, QtGui import sys class Hello_World(QtWidgets.QWidget): def __init__(self): super(Hello_World, self).__...
asked by 08.03.2018 / 17:34
1
answer

Python, Game of Life Implementation

I noticed that there is already a question related to this question, but my implementation will be different. The code I have at the moment is the following: import sys, pygame pygame.init() size = width, height = 125, 125 black = 0,0,0 w...
asked by 09.03.2018 / 16:19
2
answers

Higher and lower value problem with while. (Without using list!)

Write a program that reads an integer N and then read N  real numbers, separating the smallest and largest, presenting them on the screen. N = int(input("Digite N: ")) i = 0 ma = 'maior' me = 'menor' me = x while i < N: x = float(input(...
asked by 29.03.2018 / 16:19
1
answer

How to import matplotlib._cntr using the LTS (2.2.0) version of Matplotlib?

To build GeoJson files, use the ._cntr import matplotlib._cntr as cntr When trying to load it using matplotlib 2.2.0 it returns error: ImportError: No module named _cntr How can this module be imported? Older versions of matplotlib a...
asked by 07.03.2018 / 19:22
1
answer

Select greater value from a list // Python

I have the following problem: I need to create a program that reads a random list of positive and negative values, and returns the highest value. As a workaround, I've tried using while, if and max (), but none of these are working. With t...
asked by 30.03.2018 / 19:52
2
answers

Lists in PYTHON

I'm using lists to do a program. Initially I wanted to make a program that would create as many variables as one wanted, but I ended up finding an easier way. I thought about creating a list and adding 10 elements to it. After that the program w...
asked by 01.04.2018 / 05:27
3
answers

List a range of numbers and add one by one

I do not know how to start, I would like to know how to add a number to another in a range for example: 2 = 2 3 = 5 4 = 11 And so on I can not go on, if anyone can help me thank you right away.     
asked by 01.04.2018 / 15:23
1
answer

Regular expression that returns next words

Well I'm working on a regular expression that picks up license plates, my interest would be not to just pick up the plates, but like things close to it, for example: |Placa:AVX-4300 Fiat Uno | Here is the expression that I am using...
asked by 11.03.2018 / 20:45
1
answer

Tuple ordering exercise

I'm catching up on a Python exercise. It asks for the following:    Create a function that:       Get a list of tuples (data), an integer (key, zero by default) and a boolean (reverse, false by default).    Return data sorted by the item i...
asked by 10.03.2018 / 17:14
1
answer

In pandas and unidecode, how to avoid warning messages - copy of a slice from a DataFrame?

In Python3 and pandas I'm reading CSV files to create dataframes. In some columns I need to remove the accent (Portuguese). I do this with unidecode But in some files a warning message appears import pandas as pd import unidecode def f(str...
asked by 02.03.2018 / 15:03