Posts by Wellington Fonseca • 139 points
13 posts
-
0
votes1
answer24
viewsA: Accessing a variable from a developer
I was able to find the answer to my question, but before we get there stay tuned. My need was to use the decorator to validate an access and consume some variables through this decorator, as…
python-3.xanswered Wellington Fonseca 139 -
-2
votes1
answer24
viewsQ: Accessing a variable from a developer
I’ve done a lot of searching, but I can’t get where I think I can get. Below I found these two possibility of decorators, I made a small modification for tests, see that inside the say_whee i want…
python-3.xasked Wellington Fonseca 139 -
1
votes2
answers51
viewsA: When one Function terminates the other ends also multiprocessing asynchronous functions
In this case I would use a class and consider an internal class variable as parameter, do the test: from multiprocessing import Process class Classe: processar = True def a(self): while True:…
-
1
votes2
answers261
viewsA: Python Mysql Connector 2 cursor
What happens is you’re creating two cursor and when you close one of them, it automatically closes the other. Because it’s the same connection, differentiating only where you stored the cursor. I…
-
0
votes2
answers55
viewsQ: Python: Run class or element inside a class
there is some way to execute a def that is within a class or some other element that I do not know about without the need to include the () of the class, only with the name? See the example below of…
-
0
votes1
answer59
viewsA: How to print lines in txt from a variable and manipulate this data - Python
I ran the test here and it’s bringing up all the data from the archive. However, the way you want to treat this data I did not apply, because I do not know in fact how you want. If it is not in the…
-
1
votes1
answer118
viewsA: Typeerror: fetchall() takes in Arguments (1 Given)
What happens is that the fecthall has already transformed the result of the consultation into a array and now with the for you only need to extract this values that were stored within resultado. As…
-
1
votes2
answers109
viewsA: Instagrambot: When trying to like instagram photo, class is not found
Hello, try to change: driver.find_element_by_class_name('//button[@class="_8-yf5 "]').click() for: driver.find_element_by_class_name('_8-yf5').click() For I believe this method you are using…
-
1
votes1
answer39
viewsA: How can I use more than one function in the same Thread?(python)
Hello, this would be the solution you are looking for? import threading import time def printar_um(): for x in range(0, 5): print("\nprintar_um") time.sleep(1.0) def printar_dois(): for x in…
-
1
votes1
answer31
viewsA: Performance - Separate log tables or leave them in the same database
Hello, I believe that keeping the logs in the same database becomes better in the matter of separating company or applications through them. But if your concern is to gain storage, I recommend…
-
0
votes1
answer344
viewsA: Send Photo to Telegram Bot Python
I believe that with python-Telegram-bot it will be simpler what you want to do. https://github.com/python-telegram-bot/python-telegram-bot/wiki/Code-snippets#post-an-image-file-from-disk Here is a…
-
0
votes1
answer100
viewsA: How do I use Python to validate the product column versus its corresponding tax by the xlsx file
for excel file analysis I recommend openpyxl: https://openpyxl.readthedocs.io/en/stable/usage.html Below is a simple use of this lib. >>> from openpyxl import load_workbook >>> wb…
-
1
votes1
answer107
viewsA: How to load . txt files from a directory including in the list or dataframe the name of this file in Python?
If I have understood correctly, this would be the result you want? allLines = [] path = 'C:/data/txt/' fileList = os.listdir(path) for i in fileList: file = open(os.path.join('C:/data/txt/'+ i),…