Questions tagged as 'python'

1
answer

Anaconda / osx - change the default version of python

I was using python with anaconda on osx 10.8 and the spyder crashed. When I tried to reboot, the launcher showed the spyder as not being installed. I figured the anaconda might have had a problem and rebooted the computer, but the problem contin...
asked by 29.05.2014 / 09:46
2
answers

Print reverse order

Given a number x, where 1000≤x
asked by 23.08.2018 / 02:10
3
answers

Functions in Python-Global and local variables

Can you allow the variable inside a (local) function to be global? If not, what form can we declare a global variable?     
asked by 06.07.2018 / 05:24
1
answer

python - strange tie

I'm almost finishing my application. In the final moments of the code I'm locking in a loop that I can not resolve. # O programa pede para o usúario inserir uma data no formato dd/mm/aa, # e efetua uma série de cálculos simples até chegar num...
asked by 23.03.2018 / 16:45
1
answer

Error reading JSON

I'm trying to read the JSONs from a folder and get the proper values, I already tested all the JSONs to see if they were valid. The folder with the JSONs is called 'test' for dirname, dirnames, filenames in os.walk('test'): for filename in...
asked by 10.11.2014 / 16:23
1
answer

Voice command manager Siri [closed]

I know my macbook has tts (text to speech) when typing command say. I would like to know if there is any API or some library that works with this in python. Or would it have to do manually? Does anyone recommend something? Thank you.     
asked by 05.05.2017 / 03:55
2
answers

Tkinter GUI hangs when looping

I'm new to programming, and I've had some trouble running the code perfectly. I chose the python language because of its flexibility. For some time I've been trying to create a macro with a GUI, I use Tkinter, the window is the way I plann...
asked by 13.01.2016 / 03:24
2
answers

Compare Hash of two files in Python

I need to compare the hash of a.txt and b.txt files using a native python3 library. I tried to do this: import hashlib file_0 = 'a.txt' file_1 = 'b.txt' hash_0 = hashlib.new('ripemd160') hash_0.update(file_0) hash_1 = hashlib.new('ripemd1...
asked by 04.01.2019 / 14:45
3
answers

Problems with pip install to install VirtualEnvWrapper in Windows

I am trying to install virtualenvwrapper to then install Django. For this, I installed pip , but every time I try to run in CMD: pip install virtualenvwrapper-win The error appears:    Could not find a version that satisfies...
asked by 05.07.2017 / 15:58
2
answers

Filtering elements of a list in Python

I'm trying to remove all numbers equal to 1, but it's giving this error    list index out of range Follow the program lista= [2, 3, 1, 5, 1, 7, 8, 8, 9, 15, 1, 1] qtd = len(lista) for i in range(qtd): if(lista[i]==1):...
asked by 14.03.2017 / 20:20