Questions tagged as 'python-2.7'

1
answer

List being modified without implementation

I have a problem where the list I am working on is being modified even though there is no passing of values to it. from random import * from numpy import * m=2 lista_inicial=[[1, 2], [0, 2], [0, 1]] lista_aux = [] lista_aux = lista_inic...
asked by 14.09.2016 / 14:11
1
answer

How to repeat a call of a function of every X seconds in PyQt?

I'm developing a small application in Pyqt4 where I need to load the data into a table coming from a Webservice. This I was able to do quietly. But now, I need to update this every 1 minute. How can I do a repetition of a call to a function e...
asked by 11.11.2016 / 12:14
2
answers

Sort dictionary by Python value

I have a dictionary with the following format dic={759147': 54, '186398060': 8, '199846203': 42, '191725321': 10, '158947719': 4} I'd like to know if there's any way to sort it by value and print it on the screen. So the output is. '15894...
asked by 18.12.2016 / 05:18
1
answer

How to exit a loop with hotkeys

I have an application that runs in the background in an infinite loop. How do I stop the loop using hotkeys ( Ctrl + F1 ~ F12 )?     
asked by 21.06.2015 / 04:01
2
answers

What function do I use to return or show all equal numbers in a list of 20 numbers?

n = [] for i in range(20): n.append(int(input("Digite o número: ")))     
asked by 15.05.2017 / 02:40
2
answers

Data entry without echoing on the screen

entrada = input("digite a senha") If I use the input function, what the user types will be echoed on the screen. How to make sure nothing is shown on the screen?     
asked by 10.08.2016 / 17:36
1
answer

running split () to form a list within another list

I have the following list: [['a:/, b:/, w:/, g:/, f:/, d:/Downloads/Torrent/End, x:/files.2t, y:/files.1t'], ['d:/Dropbox/project/rato_bat'], ['data']] But I wanted it to be a list inside another list because I did this: for a in lldi...
asked by 26.07.2016 / 20:41
1
answer

Sort list lists with two sorting criteria

If I have a list of lists like this: lista = [['ana','1'], ['joao', '3'], ['rita','2'], ['alice','2']] I first want to sort the list according to the numbers, to look like this: lista = [['ana','1'], ['rita','2'], ['alice','2'], ['joao',...
asked by 30.11.2015 / 20:41
3
answers

Searching for a list minimum by ignoring zero values

I have a list of values with elements zero and elements different from zero and wanted to return the lowest value of the list and its index, but ignoring the zeros, that is, the fact that there are zeros does not mean that it is the smallest val...
asked by 04.04.2016 / 20:04
1
answer

Python - Test Read Permissions

Is there a function that returns, in Python, True if I have read permissions on the file in python?     
asked by 04.03.2015 / 00:31