Posts by Marcelo Zochio • 142 points
10 posts
-
1
votes1
answer30
viewsQ: Bug in Python Whirlpool library
I installed the Whirlpool library in Python 3.6.5 and Python 2.7.9 to compute hashes with it. However, she presented an unusual problem: in conjunction with other libraries, it works, and when it’s…
-
0
votes2
answers3404
viewsA: Take a Tkinter entry and save to a variable
def It’s function, and everything you program in a function is only valid for it. Therefore, I arranged your code as follows, where you can see the storage of the data of the Entries mentioned in…
-
0
votes3
answers14615
viewsA: How to remove a Foreign key in mysql?
DJM_JM, I tested your command in the database created with the following script: mysql> CREATE DATABASE teste; Query OK, 1 row affected (0.03 sec) mysql> CREATE TABLE `logins` ( `id` int(11)…
-
0
votes1
answer109
viewsQ: False error opening decrypted document with Python Crypto library 2.7.9
I tested the following script in Python, using Python 2.7.9, with some adaptations made by me, available at…
-
3
votes2
answers296
viewsQ: Logic operations in Python 2.7
When performing logical operations in Python 2.7, I noticed something strange. For example, when doing 5 and 6, are obtained as a result 6. Now, the correct would be 4, because, converting these…
-
2
votes3
answers4236
viewsA: How to open . txt files in Python?
Hugo, this error is due to Python not locating the file in the location where you are trying to open it. Hence, the file is not in the same location where you are running the script. For example, if…
pythonanswered Marcelo Zochio 142 -
3
votes1
answer1076
viewsQ: Python type conversion
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…
-
0
votes4
answers3447
viewsA: Error while trying to write accents in Python files
If running the program on Windows, prefer cp1252 instead of UTF-8 in the functional comment of character encoding; works better.
-
1
votes1
answer1198
viewsA: Import of numpy package
It can be two ways: from numpy import * or import numpy
pythonanswered Marcelo Zochio 142 -
1
votes1
answer99
viewsA: Problem when unzipping file
To work with Unicode characters, you need to add a functional comment type in the script header to avoid this error. I’m talking about the # -- coding: utf-8 --, used for this case. Here’s an…