Tagged Questions
0
votes
0answers
18 views
How I can “write” with 2 different instances in device with PyAudio?
I creating a Intercom with a different USB audio cards. Im trying to write to one device with two (or more) different threads but a thread write first and the other write after (hear the sound of a ...
1
vote
1answer
17 views
python TypeError: unbound method error
I have never seen this error before:
TypeError: unbound method halt_listener() must be called with test_imports instance as first argument (got Queue instance instead)
I get it when I run this code:
...
2
votes
1answer
29 views
Cannot open pipe descriptors created by threads in Python
I just began to study the pipe method of python.
I tried to wrap the pipe descriptors into file object and read by line.
import os,time,threading
def child():
while True:
time.sleep(1)
...
0
votes
0answers
17 views
Concurrently searching a graph in Python 3
I'd like to create a small p2p application that concurrently processes incoming data from other known / trusted nodes (it mostly stores it in an SQLite database). In order to recognize these nodes, ...
0
votes
1answer
25 views
Python thread not starting.
I am having issues with my halt_listener thread. I can start import_1 but it will not spawn a halt_listener thread. I am patterning this after known good code, the only difference was in the last ...
0
votes
1answer
43 views
Toggle a loop on and off in a multi-processed program in Python
I am currently running a simulation program in Python that requires me to run a large number of processes. Each of these processes has a loop that executes a certain block of code.
The problem I am ...
2
votes
2answers
464 views
Python threading multiple bash subprocesses?
How does one use the threading and subprocess modules to spawn parallel bash processes? When I start threads ala the first answer here: python multithreading for dummies, the bash processes run ...
4
votes
1answer
1k views
Periodically execute function in thread in real time, every N seconds
I have a threaded class whose loop needs to execute 4 times every second. I know that I can do something like
do_stuff()
time.sleep(0.25)
but the problem is that is doesn't account for the time it ...
2
votes
3answers
4k views
How can I kill a thread in python
I start a thread using the following code.
t = thread.start_new_thread(myfunction)
How can I kill the thread t from another thread. So basically speaking in terms of code, I want to be able to do ...
3
votes
2answers
3k views
Python how to stop threading operations
I want to know how can I stop my program in console with CTRL+C or smth similar.
The problem is that there are two threads in my program. Thread one crawls the web and extracts some data and thread ...
1
vote
1answer
325 views
Tkinter -> program freezing durint the execution of a function
I've created a little GUI for one of my scripts. All is working well.
When I click on one Button, it launches a big function that is parsing a lot of data from some websites.
But once I've clicked ...
6
votes
2answers
13k views
Stopping A Thread (Python)
I'm looking to terminate some threads after a certain amount of time. These threads will be running an infinite while loop and during this time they can stall for a random, large amount of time. The ...
2
votes
1answer
6k views
python multithreaded server
What I'm trying to program is a simple multithreaded python game server for fun. After much frustration I've not been able to figure out why my test client connection times out. Here's my server.py ...
10
votes
4answers
9k views
Creating Threads in python
I have a script and I want one function to run at the same time as the other.
Example code I have looked at:
import threading
def MyThread ( threading.thread ):
doing something........
def ...
8
votes
4answers
21k views
Simple threading in Python 2.6 using thread.start_new_thread()
I'm following a tutorial on simple threading. They give this example and when I try to use it I'm getting unintelligible errors from the interpreter. Can you please tell me why this isn't working? I'm ...