Tagged Questions
0
votes
2answers
27 views
Multithreading in python using queue
I am quite new to Python and I need to implement multithreading in my code.
I have a huge .csv file (million lines) as my input. I read the line, make a rest request for each line, do some ...
0
votes
0answers
13 views
Python WSGI apps, threading, and celery
Let's say I have a python WSGI app (Flask, but I'm more curious about general concept here), and in this app I have an instance of the following class:
class Simulator:
def __init__(self):
...
1
vote
1answer
33 views
Network resources for TCP connections in python [Windows]
Not sure if I have myself a problem with a python script I'm using.
Basically, it spawns threads, each creating a tcp connections.
Well the script finishes, i even check if any threads are still ...
1
vote
1answer
30 views
Python2.6.5 : Is there python equivalent of Java Semaphore tryAcquire
I am looking for python alternative for Java's tryAcquire Semaphore function. I found out that this function is added in python version 3 and after. I am using python version 2.6.5. Any alternatives ...
0
votes
1answer
36 views
Threading with Tkinter
I need to be able to send control c to the new thread that I start. How would I go about this. I can start the thread, but I need to stop like I do in the command line using control c.
from Tkinter ...
1
vote
4answers
74 views
Run bash script in thread not blocking the main loop
I have a python programm that I want a progressbar to be pulsed when I run a bash script in a thread and show some messages.
When I click a button, the thread is started launching the script, but the ...
0
votes
1answer
24 views
python threading and progressbars
Hello I am relitively new to python and I have a copple of questions regarding a script I was trying to write (below).
`
import Tkinter as tk
import ttk
import time
import threading
def foo():
...
0
votes
1answer
22 views
How to run separate threads in pygtk
I have a pygtk application which runs as soon as my python script is opened. Along with gtk.main() I have a thread which is started at the beginning of the script, which refreshes a gtk.TextView() ...
1
vote
1answer
59 views
Sending arguments to Python threads blocks other threads
Consider this test application for passing arguments to Python threads:
#!/usr/bin/python3
from pprint import pprint
import signal
import sys
import threading
class CallThreads(threading.Thread):
...
0
votes
0answers
22 views
Python threading: Queue workers - hang the program
I'm trying to implement a simple Queue with workers that do something.
The program should wait until the workers have finished emptying the queue, and continue execution.
I took the documentation ...
0
votes
1answer
22 views
Python equivalent of Java's `tryLock` (idiomatic)?
In Java tryLock(long time, TimeUnit unit) can be used as a non-blocking attempt to acquire the lock. How can the equivalent in python be achieved? (Pythonic | idiomatic way is preferred!)
Java ...
0
votes
2answers
50 views
Python Threads not finishing
I'm currently testing something with Threading/ workpool; I create 400 Threads which download a total of 5000 URLS... The problem is that some of the 400 threads are "freezing", when looking into my ...
0
votes
0answers
15 views
SqlAlchemy in threads in Twisted
I'm building a Twisted application in Python 2.7 and am trying to use SqlAlchemy to interact with the database. I've got a working application that is leaking memory, and am not sure how to find the ...
0
votes
1answer
15 views
Python 3.3 Multithreading argument sequence
I have been making a small piece of code to test threading while a FOR loop is running, and also running different functions in a different class.
The code works very well, except that if you want it ...
4
votes
1answer
86 views
Python: How do you stop numpy from multithreading?
I know this might seem like a ridiculous question, but I have to run jobs on a regular basis on compute servers that I share with others in the department and when I start 10 jobs, I really would like ...