multithreading

Multi-Threading with selenium and Python Background processing

Multi-Threading with selenium and Python Background processing Question: I currently trying to auto login into a website and fill a form. I’m using selenium in python and am trying to multi thread each username in a different driver. Issue is that drivers does open parallel to each other in the background yet they seem to …

Total answers: 1

Starting n threads with same function at diffrent times

Starting n threads with same function at diffrent times Question: I’m currently working with Tkinter to create a GUI for my Script. Among other things there is a function which writes and save some Data in some Files. To visualize the progress for the User i got an label which shows the progress. When i …

Total answers: 1

Threading decorator is not callable

Threading decorator is not callable Question: I am implementing a thread as a decorator to a class which should apply threads to the method, all concurrently. However, I get the following error: TypeError: ‘TEST_THREAD’ object is not callable The example below should print out each iteration over the maximum thread number. def start_workload(NUM_THREADS): def wrapper(fn, …

Total answers: 1

Using multithreading with time.sleep and unique loggers

Using multithreading with time.sleep and unique loggers Question: I’m trying to make sure that several threads start as close to each other as possible, and for that I’m using time.sleep. Each thread will have its own logger, which will output to its unique file. There’s something very strange happening though… Sometimes, not all logger files …

Total answers: 1

Multi-Thread Binary Tree Search Algorithm

Multi-Thread Binary Tree Search Algorithm Question: I find implementing a multi-threaded binary tree search algorithm in Python can be challenging because it requires proper synchronization and management of multiple threads accessing shared data structures. One approach, I think is to achieve this would be to use a thread-safe queue data structure to distribute search tasks …

Total answers: 2

Python Parallel plotting and and input reading

Python Parallel plotting and and input reading Question: I am seeking help with understanding why multithreading does not work correctly in this example: import time import matplotlib.pyplot as plt import concurrent.futures voltage = list() stop_flag = False fig, ax = plt.subplots() fig.show() def plotter(ax, arr): while True: if stop_flag: print("stream interupted") return arr.append(1) ax.clear() ax.plot(arr) …

Total answers: 1

Unable to share global variable between threads with flask

Unable to share global variable between threads with flask Question: Context I’m trying to write a python flask server that answers a simple request. The data to be returned in the response is queried from a backend service. Since this query may take some time to complete, I don’t want to do it synchronously, I …

Total answers: 1

Suggest faster way to check if a proccess is active or not

Suggest faster way to check if a proccess is active or not Question: I am developing a solution that is a voice chatbot using a Raspberry pi 4 and aws lex due to having many if condition and many stuff to check It takes a little bit of time to reach the recording part that …

Total answers: 1

Python thread calling won't finish when closing tkinter application

Python thread calling won't finish when closing tkinter application Question: I am making a timer using tkinter in python. The widget simply has a single button. This button doubles as the element displaying the time remaining. The timer has a thread that simply updates what time is shown on the button. The thread simply uses …

Total answers: 1