Questions tagged as 'python'

2
answers

How to get a list of processes running windows in python?

I would like to know how to get the processes running from windows and store them in a list in python. from os import system system('tasklist') I know that the code above shows the processes, but I would like to have them put in a list even...
asked by 05.01.2017 / 17:38
1
answer

Reading CSV file accented in Python?

I'm learning python3 and I ended up packing on the issue of reading a simple csv file that contains the character 'à'. I've tried using decode, encode that I found on the internet but nothing seems to work, it is always printed as '\ xc3 \ xa0'....
asked by 26.12.2016 / 05:38
2
answers

I would like to know what the function of: {} in the Python language is and more specifically within the PRINT function as in this code?

I would like to know the function of: {} in the Python language and more specifically within the PRINT function as in this code? Salario = int(input('Salario? ')) imposto = 27. while imposto >0.: imposto = input('Imposto o...
asked by 28.12.2016 / 17:09
2
answers

How to repeat the code at the end in python?

So, I'm starting programming (just by appending it myself) and wanted to know how to do code to restart at the end. I know it may seem like something simple but I do not take any courses, I'm learning alone lanchonete = ("500$") açaiteria...
asked by 17.04.2018 / 03:33
3
answers

list index out of range when trying to resolve google developer day 2010 issue

First, I'll copy here the statement of the question to be located: In the quiet country village of Ponteironuloville, all phones have 6 digits. The telephone company establishes the following rules on numbers: There can not be two consecu...
asked by 14.03.2015 / 02:50
2
answers

How to check if a method exists in a class in Python?

How to check if a method exists in a class in Python? Is there a function that does this? class Test(object): def method(self): pass For example, I'd like to check through a condition if a given method exists to call it if...
asked by 07.04.2017 / 01:59
1
answer

Type conversion in Python

When writing some didactic examples in Python 2.7, I came across the following situation in the following program: a = 0b101 b = 0b111 c = a+b print c The result of this program is 12 (decimal). If I want a binary value to be displayed in t...
asked by 01.05.2017 / 21:10
2
answers

Grouping table

I have this table and would like to set up a list or another table users_ID_User Material Rating 0 A "Hey Pogo!...from citation to fulltext" 5 1 B...
asked by 28.08.2018 / 02:44
2
answers

Nested lists in python

I need a help, let's say I have the following list: lista = [1,2,3,4,5,[6,7,8,9],10,11,12,13,14,15] If I want to print each of the items in this list I would do one: for i in lista: print(lista) So far so good. However, I wanted to...
asked by 07.03.2018 / 14:33
1
answer

What is the purpose of if __name__ == '__main__': if kivy can run the application without this line of code? [duplicate]

In the kivy documentation it shows that pro app works is needed if __name__ == '__main__': MyApp().run() But I try to remove the if condition; and the app performed anyway; Somebody explain to me why, please!     
asked by 02.03.2018 / 15:30