Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
Filter by
Sorted by
Tagged with
-1 votes
2 answers
204 views

I am currently working on implementing a toy store server using Python, employing socket connections and a custom thread pool for handling concurrent client requests. However, I'm facing some ...
Tanay Joshi's user avatar
1 vote
1 answer
61 views

Is it necessary to pass a shared variable explicitly to a threading function like i have shown below (First example ) in Python 3.10+ Os is Windows 10,Python interpreter is CPython or is it ok to ...
Rahul.In's user avatar
-1 votes
1 answer
26 views

the main premise of the problem is to build a first responders system of sorts, which pings location to a server when a collision occurs(collision is currently an event triggered when the key k is ...
shanmuga's user avatar
1 vote
0 answers
42 views

I want to build a python script that start a subprocess and launches a CLI command(the cli command can take hours to run), so I want the main python to continue, however deploy a watcher, that keeps ...
crazywolf's user avatar
0 votes
1 answer
863 views

I use async version of pyTelegramBotApi for a Telegram bot part. I use vk-api for a VK part (not sure if that matters). I have a bot that monitors other social network (Vkontakte) and, on some ...
MeloMan's user avatar
  • 61
0 votes
0 answers
188 views

I would need advice how to use multithreading with python. I'm currently using the concurrent.futures librairy but the results i got seem to be slower than expected. Here an example : I need to ...
Magic Mushroom's user avatar
0 votes
0 answers
177 views

i have created a script which catches files in a folder and does conversion operation (from word to pdf) and it creates folders based on their file names and places them in there. However, problem is ...
Fatih Enes's user avatar
0 votes
1 answer
71 views

i'm trying to write a socket-server program to send keyboard inputs from my PC to my Raspberry Pi, but when i create a new thread for a function, that has a while loop in it, the script execution does ...
Selim Cifci's user avatar
1 vote
1 answer
570 views

All, I have been using blpapi with Python to query reference data (//blp/refdata) without issues and I've recently been using the streaming endpoint (//blp/mkdata); so my environment is set up (yes ...
ghbcode's user avatar
  • 79
0 votes
0 answers
84 views

Assume following code : import concurrent.futures import time import itertools def task_function(task_id): print(f"Task {task_id} started") time.sleep(10) # Simulating some work ...
Amir's user avatar
  • 334
2 votes
1 answer
524 views

Here's how I understand it (please correct me if I'm wrong): Python switches between Threads in certain time intervals. Additionally when waiting for an I/O Operation Python releases the GIL so that ...
Butters's user avatar
  • 41
0 votes
1 answer
80 views

I have done some reading on the topic and found that we can use threading if some problem is io-bounded but io is not very slow. But I couldn't understand why we still couldn't use asyncio? Since ...
Wenuka's user avatar
  • 1,130
0 votes
2 answers
9k views

Whenever i use xxx.join() it never works, eitehr just stops and doesnt carry on the rest of the code or crashes my program. in this case crashing my program. i usually make do without it, but for my ...
ImTooMad's user avatar
0 votes
1 answer
873 views

i have a function in a my_fuction.py def my_function(): # do something print("doing something") return True i also have a a threading.Thread inhereting class called my_thread....
Clyyie's user avatar
  • 1
0 votes
0 answers
37 views

Edit: Actually, execution does end eventually. However, there is a 6 second delay or so between when the window closes and when code execution actually terminates, a gap that is not present when the ...
Ang_d's user avatar
  • 39
0 votes
0 answers
71 views

I have a small python opencv code to predict age and gender. I also have a GUI tkinter library to print the age on a separate window. import cv2 import math import time import argparse import requests ...
Monty Swanson's user avatar
0 votes
1 answer
1k views

I'm using Python's ThreadPoolExecutor to execute a function concurrently on different threads. The executed function returns an enum PytestResult and afterwards I'm logging the returned result and ...
user20395797's user avatar
0 votes
0 answers
108 views

I'm trying to write a script that plays pure tones (fixed frequency sine waves), whilst connected to a bluetooth device. I'm using bleak and asyncio to connect to the bluetooth sensor, and want the ...
oweydd's user avatar
  • 141
0 votes
1 answer
177 views

I'm consuming a queue and need to pass the data to a thread pool for processing, but I don't want to consume more items than the thread pool can handle. In other words, I want the thread pool to ...
Ivan Voras's user avatar
  • 2,030
1 vote
1 answer
1k views

I have a python program that I run in VSCode but at one point I'm getting this RuntimeError: can't create new thread at interpreter shutdown and I'm not even closing anything, I don't understand. And ...
TooFu's user avatar
  • 19
1 vote
1 answer
176 views

I need a Python script where a background thread writes data to a file, while the main thread might read from it. I know writting to a file from multiple thread can be problematic, but is it OK if ...
11011100's user avatar
  • 125
1 vote
1 answer
124 views

import multiprocessing as mp pool = mp.Pool() def calc(i): return i * 2 def done(results): for result in results: print(result) def loop(): pool.map_async(calc, [0, 1, 2, 3], ...
MirceaKitsune's user avatar
0 votes
0 answers
36 views

i watched this video and written this code in python https://www.youtube.com/watch?v=oYoVx8ZuvTw but my code is acting as thread safe why please see video to understand my query import threading ...
nketu06's user avatar
0 votes
1 answer
68 views

I want that, while the program is running, all the keys I type are ignored. In a simple example, the problem I want to solve is the following. from time import sleep sleep(5) If I type something ...
Daniel Sánchez's user avatar
1 vote
1 answer
359 views

I am trying to connect to a server and download all the attachments from said server. I have these 2 functions. download_File() simply downloads the file from the server. downloadFiles() 1. connects ...
ahmad's user avatar
  • 71
0 votes
1 answer
248 views

I created a thread in the main code. Inside the thread I call a procedure outside the thread. The called procedure runs fine except a line that's supposed to run an ib order, which throws the error &...
CHK's user avatar
  • 1
0 votes
1 answer
81 views

I'm building a bot that takes sound from a game, cross refrences it with a target sound, and if a target sound is detected does some actions. I have a timer that runs from the time I press "start&...
Chris Dk's user avatar
0 votes
1 answer
310 views

I have simple producer, consumer problem. While producer thread adding 10$ to global money variable, consumer thread will spend money. But there is one condition that money cannot be under 0. The ...
Burak's user avatar
  • 21
0 votes
1 answer
194 views

I have a Python server which serves some long-running queries for large amounts of data from a Postgres DB. The requests are served via WebSockets, and the server uses asyncio and aiohttp as the main ...
Luigi D.'s user avatar
  • 315
1 vote
0 answers
208 views

I am debugging a celery worker running in a docker container. Celery version: 5.2.7 broker: rabbitmq results backend: redis profiling: py-spy 0.3.14 docker: 24.0.7 I launch the celery worker with: ...
probably45's user avatar
1 vote
1 answer
2k views

This demo app runs a python process with a Plotly / Dash user interface. When it starts Dash with app.run_server(debug=True) the following error is raised: Exception in thread Thread-1 (dashfun): ...
mgb's user avatar
  • 119
0 votes
1 answer
68 views

I have the following situation: I have a class called Server, which is, as the name tells, the class which starts the server and is supposed to stop it. Here's the code: import socket import threading ...
Alexander Chereji's user avatar
1 vote
1 answer
254 views

The term Synchronization primitive is used in many places in the documentation of threading. I have referenced one such usage in the description of RLock: A reentrant lock is a synchronization ...
tru's user avatar
  • 181
0 votes
0 answers
245 views

I'm writing a script that does the following: Gets the number of available VMs and put them in a stack Discover tests files and put them in a queue Runs the tests concurrently on each VM To achieve ...
user20395797's user avatar
0 votes
0 answers
79 views

The general use case: I want to parallelize the executions of a Python script with multiple inputs. The inputs are wordlists (.txt files) of different sizes (from 2.000 to 3.000.000 rows). The setup: ...
nostripe's user avatar
0 votes
0 answers
51 views

Ive got three threads. One for getting Data from a device. One for calculation something and the last is a tkinter thread. Everytime one of these threads has an error a Device needs to be resetted. ...
GlumandaGandalf's user avatar
3 votes
0 answers
96 views

The Python documentation states that On Windows, if secs is zero, the thread relinquishes the remainder of its time slice to any other thread that is ready to run. If there are no other threads ready ...
nadlr's user avatar
  • 248
0 votes
1 answer
672 views

I have a strange issue with my canbus thread, maybe somebody here is able to help. I set up a test environment with the class below and another file thats just simulating the other can module via ...
Traxan's user avatar
  • 102
0 votes
1 answer
70 views

I have a code that will play an alarm then when I press h it should stop working here's the code: import winsound from threading import Thread import keyboard import sys alarm_flag = True def alarm(): ...
ParsaTheH's user avatar
-2 votes
1 answer
61 views

Let's say I have 2 functions like this: Function 1: To Calculate a. And it takes 5 hours to return the result of a for each calculation. def Calculate_a (x,y,z,t) Do_somthing_to_calculate_a ...
Minh's user avatar
  • 11
0 votes
0 answers
43 views

I have a webserver with incoming requests for data processing. The processing must be performed by a stateful worker (e.g. an exclusive database connection), but an arbitrary number of workers can run ...
xaa29221's user avatar
0 votes
1 answer
47 views

I'm using Partial method to pass 2 parameters which are not iterables, thus i shouldn't use that in the Map() function. I'm also using ThreadPoolExecutor for I\O bound task that i have here. the ...
Mostafa Bouzari's user avatar
0 votes
1 answer
74 views

I am trying to build a splash screen that I will be able to call from an external application using Tkinter. I'd like to define my GUI in a class, like this: class Splash: def __init__(self): ...
Ben Zelnick's user avatar
0 votes
0 answers
50 views

I have an indeterminate number of csv files. I want to back them up, then process them and save the result in the same file. The process is kind of heavy and it involves manipulating the values in the ...
KansaiRobot's user avatar
  • 10.6k
0 votes
1 answer
269 views

I'm looking for help for my project with threading and sockets. I have to make a communication between a server and few clients, and I have to do a GUI. The issue is that when I use QRunnable, the GUI ...
Missclick's user avatar
0 votes
1 answer
167 views

I have written the following class: class AsyncPillow: def __init__(self, FUNC: Callable, ARGS: tuple, POOL: ThreadPoolExecutor = None): self.FUNC = FUNC self.ARGS = ARGS ...
Fluxx's user avatar
  • 15
0 votes
1 answer
74 views

I am using django ORM to communicate with MySQL database inside the callback functions of my RabbitMQ consumers. These consumers are running on a separate threads and each consumer has established its ...
Ahmed Mustafa's user avatar
0 votes
0 answers
318 views

I am writing a part of a basic FFmpeg GUI application, and this is the installation code. While setting install_progress_bar from the 'download_thread' the terminal is spammed with QObject::setParent: ...
KaneryU's user avatar
0 votes
0 answers
381 views

I have a problem that I just can't solve on my own. There is a Python script that looks something like: from threading import Thread import threading import pymssql lock = threading.Lock() global_list ...
Lainur's user avatar
  • 3
0 votes
1 answer
157 views

I have a Flask application deployed using gunicorn. I'd like to integrate the application with a Zookeeper ensemble using kazoo, as the app relies on having up to date data from a get_children() call ...
Fijoy Vadakkumpadan's user avatar

1 2 3
4
5
83