Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

I am trying to create a client-server app in which the client can send a HTTP request with files to the server to start a process of training an AI model. I want the client to be able to get updates ...
vct12345's user avatar
0 votes
1 answer
174 views

I'm using a thread from the threading package to launch a function that performs spark streaming. I want to stop the thread inside the process function when a condition is met. import threading import ...
Oth Mane's user avatar
0 votes
1 answer
44 views

I am making a speech recognition program in python where I want that when I say "above", it will continuously run the loop to press the down key until I again don't say above, but now after ...
Piyush Mandal's user avatar
1 vote
1 answer
228 views

I'm trying to stop a dash server within a thread, but it doesn't work: Here's a minor example of the issue : import threading import requests from dash import Dash, html from flask import Flask, ...
James's user avatar
  • 99
0 votes
1 answer
65 views

I have been trying multiple ways to try and get a variable from file#1 to file#2 but every time I import file#1 to file#2 it seems like file#2 fails to work. I think this is due to file#2 being run in ...
ML13C's user avatar
  • 1
0 votes
1 answer
152 views

I wrote this function but is some times give me this error "Authenticated as Muhammad Zair [ WARN:[email protected]] global cap_msmf.cpp:1768 CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. ...
ZR07's user avatar
  • 1
0 votes
1 answer
53 views

The code below, which I’ve modeled after the code I'm working on and simplified for the purpose of this question, doesn’t seems to be using p.join() properly to manage the processes created by p.start(...
Guy Cherkesky's user avatar
1 vote
2 answers
124 views

I have a 4GB+ file in which each line represents a very nested JSON string. An example of what the file looks like would be below: {"core":{"id":"1","field1":{&...
user1330974's user avatar
  • 2,626
0 votes
0 answers
71 views

I am trying to understand threading and if/when its use is the most appropriate in context of a project I am working on. I am running this on a RPi 4, using python. I have a fairly large script, two ...
IronDad75's user avatar
0 votes
1 answer
154 views

I'm using a Raspberry Pi 4B and a development kit which contains sensors and sends the data via BLE. The project consists of a Raspberry Pi working as an Edge device where it reads sensor data via BLE,...
aag's user avatar
  • 1
0 votes
0 answers
57 views

I have the code below. read_sql is method on my DBReader class and it's using pd.read_sql. Im parallelizing sql selects to the Postgres sql table. import pandas as pd def read_sql(self, sql, params =...
mike01010's user avatar
  • 6,204
0 votes
0 answers
52 views

I don't know how to make those two functions (which are called in the code below at the end) parallel. If I do multitasking or multiprocessing I came across errors regarding multiple port access. If I ...
pauk's user avatar
  • 408
0 votes
0 answers
80 views

I'm running a stream data processor on AWS ECS (EC2) by polling for messages in an SQS queue. I use a ThreadPool as shown below (some of the code is omitted for brevity): def process_messages(self, ...
Vedank Pande's user avatar
0 votes
0 answers
201 views

I am using Python 3.9 on a Raspberry Pi. I'm using a http.server.ThreadingHTTPServer so that I can run other tasks concurrently while handling HTTP requests. My needs are simple, so I don't want to ...
Stewart Macfarlane's user avatar
0 votes
1 answer
264 views

I'm experimenting with asyncio and threading to figure out which mechanism I should choose in processing a large number of files. The experiment is simple that I just want to read the files and add ...
Ames ISU's user avatar
  • 417
-1 votes
1 answer
139 views

Some time ago I posted a problem about starting a thread inside a GUI loop, in which commands should run in parallel to the GUI event/drawing loop. This was supposed to be a measurement loop, which ...
Marcin Łęcki's user avatar
0 votes
0 answers
108 views

I'm attempting to convert a Python script to C to improve its performance. The Python script involves threading, and I've translated it to C using an AI. However, when I compile and run the C script, ...
Æmmy's user avatar
  • 45
-1 votes
1 answer
62 views

I'm working on a program to check many things periodically, and give me back data on a dashboard I made using tkinter. So, to ease the whole thread starting and Stopping threads, I created a Timer ...
Balouuzard's user avatar
1 vote
1 answer
116 views

I have a Python program that uses fairly long-lived synchronous calls so things are wrapped in threads. Here's a rough MVP: class MyClass: processor = None def __init__(self): self....
Nimrod Sadeh's user avatar
0 votes
0 answers
22 views

I'm writing a client-server trivia game in python. In the game, i want the user to have an option to enter input as long as he is playing. Once the game ends (someone has won), he can no longer enter ...
Gil Ari Agmon's user avatar
1 vote
1 answer
240 views

I have been working for a long time with asyncio in Python, however I would like to clarify some thoughts on how asyncio actually works. I will break down my thoughts so that I can give context and ...
Diego L's user avatar
  • 1,008
1 vote
0 answers
208 views

I was trying to make a project related to cv in which i want to send a video stream got from camera of raspberry pi to a different laptop along with the objects detected in the frames. each frame ...
Ayushman Singh's user avatar
0 votes
1 answer
40 views

import re import concurrent.futures import time setting1 = 101 setting2 = 321 setting3 = None threads = 1000 start = time.perf_counter() def load_keywords(keyword_file): with open(keyword_file,...
Everett Smoot's user avatar
0 votes
0 answers
27 views

I've code which looks like this way: class Service: async def publish(file_obj): """Sending file_obj to s3""" def render_pdf(data: dict): &...
Leo's user avatar
  • 33
1 vote
0 answers
219 views

Is the following Python code thread-safe? More precisely, under what conditions (Python implementations, versions, GIL presence, etc) is it guaranteed that KeyError will never happen and every item ...
sashkent3's user avatar
1 vote
1 answer
27 views

I wrote a Threader class using the threading module that creates multiple threads to perform a task (function) on a list of elements. I´m passing slices of said list into a threading.Thread object ...
Altanir Junior's user avatar
0 votes
1 answer
19 views

I have this api that takes some inputs, and the code only has this line (except the import demo_v1 line): demo_v1.main(image file, text file, integer) Instead of manually writing the inputs for ...
beluga's user avatar
  • 53
0 votes
1 answer
316 views

The intent of the code below is to perform several database updates in parallel using pyodbc and mysql. Question: are the connections opened independently and in parallel? Will this code work or I ...
ps0604's user avatar
  • 1,215
0 votes
1 answer
181 views

In my Python3.12 code I have three threads in which the first thread T1 is a consumer, the second thread T2 is a producer, and the third thread T3 is a logger. However, I have three additional ...
LyLa's user avatar
  • 11
0 votes
0 answers
48 views

def run_timer(duration): import threading import time import sys class Timer: def __init__(self , duration): self.duration = duration self.remaining_time = duration ...
Allin Senna's user avatar
0 votes
1 answer
58 views

I'm writing a Python program using socket and tested listening the same port twice, using ThreadPoolExecutor. This is a minimal program that reproduces my problem: import socket import time import ...
turgenev's user avatar
0 votes
1 answer
440 views

Previously I thought this wasn't possible to non-cooperatively interrupt a Thread in Python. A example might be the main thread asking to immediately cancel other theads in the process. But, from the ...
user48956's user avatar
  • 15.9k
3 votes
1 answer
385 views

My Python program has multiple threads accessing the same Numpy array instance. Since Numpy releases the GIL, these threads can end up accessing the array simultaneously. If the threads are ...
Joris_vR's user avatar
0 votes
0 answers
46 views

I am trying to write a real-time serial data reading and ploting APP, which read data from a arduino UNO board. But there is a problem that after more 10000 dataponits readout, the ploting presents a ...
郑英杰's user avatar
1 vote
1 answer
43 views

This is my python code. It is a pinger client.It would send a messeng to the server and expect to receive the reply which capitalize the letters in 1 seconds. from socket import * import threading ...
echo_lin's user avatar
0 votes
0 answers
48 views

The code below selects and plays in slow motion the last 8 seconds of a video. Problem: When the the button clean is pressed, it resets the video path, and allows for selecting a new video (path) by ...
Old bit-RD's user avatar
0 votes
0 answers
97 views

So the thing is that I have to run a for loop and it takes some time to run, so I made a loading screen in a frame in customtkinter for my app. It goes like this- import customtkinter from PIL import ...
Shubhwins's user avatar
0 votes
0 answers
83 views

The project I am working on involves threading using a while loop which web scrapes stock prices from a website and plots this on a matplotlib graph. I am now trying enable the user to change the ...
user23520907's user avatar
0 votes
1 answer
68 views

I want to make app to read log files from FTP server - when user clicks button, it connects to FTP, changes directory and reads data every 1sec. If data changed (new logs appeared), then it adds it to ...
michalb93's user avatar
  • 131
0 votes
0 answers
77 views

when i receiving statistics from RS485,i want to save it in my MySQL database at the same time,as well as draw a plot by the statistics.As the threading in python can not satisfy my demand of ...
不在藏身于荒野's user avatar
-2 votes
1 answer
138 views

I am attempting to open a tkinter window simultaneously with a pygame window, and I have scoured everywhere and come up with this code which I have trimmed so that it is a minimum viable product with ...
George S.'s user avatar
1 vote
0 answers
34 views

I'd like to write a function where I can input any CLI command, which then runs inside it's own subprocess, and which logs it's output to a file and to the terminal. The execution of a command can ...
crazywolf's user avatar
-1 votes
1 answer
24 views

please attention to this simple program: from time import sleep from threading import Thread def fun1(): sleep(10) thread1 = Thread(target = fun1) thread1.start() #sign sleep(100) print("hello&...
farshadarbab's user avatar
0 votes
5 answers
197 views

With the following code, I want to show how to synchronize with a thread. I want to have a separate thread that updates an image. From these images, I want to have an asynchronous generator. The ...
Dronakuul's user avatar
  • 190
0 votes
1 answer
138 views

I'm working with Python's asyncio and triing to understand the run_in_executor function with the default ThreadPoolExecutor to handle blocking tasks asynchronously. My concern is regarding accessing ...
coolio's user avatar
  • 41
0 votes
2 answers
270 views

I'm trying to understand how ThreadPoolExecutor and ProcessPoolExecutors work. My assumption for this test was that CPU-bound tasks such as increasing a counter wouldn't benefit from running on ...
JaviOverflow's user avatar
  • 1,480
0 votes
1 answer
139 views

I am using multithreading to run multiple Selenium drivers at the same time. Every driver has an individual thread. When I have 70 driver instances (ThreadPoolExecutor(max_workers=70)) len(threading....
ifdef14's user avatar
  • 25
0 votes
1 answer
260 views

I have encountered a strange situation where a program won't exit due to the way python handles exceptions. In this situation, I have an object which owns a Thread, and this Thread is only shut down ...
xpilot's user avatar
  • 1,019
0 votes
0 answers
46 views

I created bot. It can handle some commands in chat and for working this part of him I use def runBot(): bot.polling(none_stop=True, interval=1, timeout=30, long_polling_timeout=65) and there is ...
Ivan's user avatar
  • 1
1 vote
0 answers
81 views

I'm working on finding a memory leak in my application, and narrowed down suspicious activity to this (simplified) code: import time import threading class Work: def by_duration(self, seconds: ...
Cam.Davidson.Pilon's user avatar

1 2
3
4 5
83