8
votes
1answer
58 views

Print 2 lines in the console concurrently in Python

I'm using Python 3 to output 2 progress bars in the console like this: 100%|###############################################| 45%|###################### | Both bars ...
0
votes
1answer
40 views

Strange django ORM behaviour with threading

I have something very strange happening with queryset results that I am trying to access in a thread started within a Django project. The issue arising is that in the init of the thread everything ...
3
votes
1answer
21 views

Python queue.get(block=true) with timeout does not return when item is added

I have 2 threads in my python application. Thread A (well, basically the 'main' thread) is added items to the queue. Thread B is getting it from the queue. Code A: def addTrade(self, date, volume, ...
0
votes
3answers
34 views

concurrent.futures.ThreadPoolExecutor.map is slower than a for loop

I am playing with concurrent.futures.ThreadPoolExecutor to see if I can squeeze more work out of my quad-core processor (with 8 logical cores). So I wrote the following code: from concurrent import ...
0
votes
0answers
13 views

Losing messages in a Python client-server-client simulator

What I am trying to do in the following code is simulating through multithreading a client-server-client chat, while recording the time it takes for the message to be received by the client. For some ...
0
votes
1answer
11 views

Python Multithreading an Image-Rendering

I am generating rather large images, and so I want to thread it to render different parts of the image at once. for startX in xrange(0, width, threadChunk): t = Thread(target = threaded_chunk, ...
0
votes
0answers
5 views

pyFLTK function `Fl.wait()` blocks all threads

When writing a multithreaded application using pyFLTK, I found a weird problem: When I call Fl.wait() then all threads are stopped until another FLTK event appears. As a workaround while Fl.check(): ...
0
votes
2answers
35 views

Using threading/multiprocessing in python to do multiple calculations at the same time

I have a list of numbers. I want to perform some time-consuming operation on each number in the list and make a new list with all the results. Here's a simplified version of what I have: def ...
0
votes
0answers
31 views

Python cannot allocate memory error

I written a python script that spawns about 10 threads and doesn't waits for them. Whereas a thread is spawned, it creates a bash script and it runs it with subprocess.Popen(). Then, the thread stops ...
2
votes
1answer
44 views

Threading advice for web crawler - scheduling with single list

I would like to add in multiple threading to my web crawler but I can see that the way the spider schedules links to be crawled may be incompatible with multi-threading. The crawler is only ever going ...
0
votes
0answers
26 views

Exception KeyError: KeyError(4303064752,) in <module 'threading'

I'm getting this error: Exception KeyError: KeyError(4303064752,) in <module 'threading' When I run: python myapp.py This python file is using the following imports: import requests, ...
0
votes
0answers
27 views

Python - keeping track of the size of a file in a multithreaded context

I have a Logthread class which is accessed by multiple other threads and writes server log-entries to a logfile. Here's the class just with its basic functionality: class Logthread(threading.Thread): ...
0
votes
1answer
25 views

Multi threading or Multi processing for opening pages in BeautifulSoup in python

I have a program that opens a long list of web pages using beautifulsoup, and extracts data from it. Obviously it's fairly slow since it has to wait for each one to complete. I'd like to make it ...
1
vote
2answers
104 views

Start a new thread or start a new process, which is better? [on hold]

In concurrent programming, one can either start a new thread or a new process. Take Python for example, threading.Thread() starts a new thread, while subprocess.Popen() starts a new process. I know ...
1
vote
1answer
34 views

What kind of problems (if any) would there be combining asyncio with multiprocessing?

As most everyone is aware when they first look at threading in Python, there is the GIL that makes life miserable for people who actually want to do processing in parallel - or at least give it a ...
1
vote
1answer
25 views

Python cache/memorize and thread locking

When asked my application should open a .csv file make a dict from it. I also need to cache that data and return from cache if its 'young' enough. Did that with a decorator: def memorize(key, ...
0
votes
1answer
23 views

Python GTK+ 3 Safe Threading

So what should I run at the beginning of my program to make it thread-safe (or thread-aware as I've read in some places): from gi.repository import Gtk, Gdk, GLib, GObject GLib.threads_init() # ...
1
vote
0answers
20 views

What are my options for fast transfer of python dictionaries and lists over zeromq sockets using pyzmq?

I've been using zeromq REQ/REP TCP sockets for communication between threads in my application so that I can easily move from threads to a distributed architecture of multiple machines in the future. ...
0
votes
1answer
17 views

Python tkinter threading trouble .delete(ALL)

This may simply be the limitation of Tkinter being main thread op primarily. Is there a way to canvas.delete(ALL) in Tkinter when also using threads. I have the program running, the long way around ...
0
votes
0answers
12 views

Destroying a Toplevel in a thread locks up root

I have a program I've been writing that began as a helper function for me to find a certain report on a shared drive based on some information in that report. I decided to give it a GUI so I can ...
0
votes
2answers
39 views

Threads in python facing trouble

I have written very basic python code for threading... import time import thread def print_hello(name,delay): while 1: print name time.sleep(delay) try: ...
3
votes
0answers
57 views

Python waiting for operation to complete before continuing

I'm writing data to a CSV file, then once that's done, I copy the file to another directory. This is all in a loop, so when the second iteration starts it reads the data from the file that was ...
1
vote
1answer
34 views

Creating many number of threads in python?

I want to create 3 threads in python ,I am using python class thread library, Is this the below is the right way to create threads in while loop? it may create problems? while (count <= 3): ...
1
vote
2answers
16 views

Why ThreadPool doesn't move next after a TimeoutError

My goal: To go through a list of websites to check them using Requests. This is being done in apply_job. My problem: When job_pool.next is called, a few websites are in error and instead of ...
2
votes
2answers
28 views

How do I automate an environment variable dependent benchmark of BLAS in python/numpy?

I need some help in figuring out how to automate a benchmark effort in python. I'm testing the effects of threading on a BLAS library calls through numpy in python. In a linux environment, ...
0
votes
0answers
24 views

Python threading with tkinter

Back to working on a program I started and partially finished back in late Nov/early Dec. I want to send a value to a program/thread, reset the value and do it again, 11 times. The programs/threads ...
0
votes
0answers
28 views

Python threading.Timer objects not triggering after multi-hour timer

I'm writing a small IRC bot which uses data grabbed from a JSON API. It's a list of events, which contains at the front any running event, followed by any future events. I'd like to alert the channel ...
0
votes
1answer
21 views

Instructing a thread to close resources

I'm currently dealing with an issue involving a list of threads who all use ssh/telnet libs. I want at some timeout value for the main thread to instruct the threads to close all their resources, and ...
0
votes
0answers
19 views

python thread lives on after stopping pydev debug

I am starting threads like this: listenThread = threading.Thread(target = self.startAutMsgListener) listenThread.daemon = True listenThread.start() when there is ...
0
votes
0answers
23 views

chat check recv() always

i want to make a simple chat program, but i have a problem, i want to always check if program receives something even i write a message, how i can to this? i don't want to write what program ...
1
vote
1answer
34 views

Async thread deadlock in Julia when used with PyCall

I'm trying to implement a basic client-server socket structure using Python and Julia, where the producer is in Python and the consumer is in Julia. My code on the Python side looks like this: def ...
0
votes
1answer
31 views

How can i create a GUI using Tkinter that can operate on a function and still accept input?

I have been trying to program a GUI for a timer ALL weekend... I'm about to just give up because I cannot find any information on how to do this correctly.. I have tried threading after someone told ...
0
votes
1answer
17 views

Why is my Toplevel() widget freezing my program on Windows but not ubuntu?

I have some source that i hammered out this weekend that is supposed to be a personal time management program for work. The modules used are, Tkinter, time, thread, textwrap and datetime. I finished ...
2
votes
1answer
63 views

Keyboard Interrupt with python's multiprocessing

I am having an issues gracefully handling a Keyboard Interrupt with python's multi-processing (Yes I know that Ctr-C should not guarantee a graceful shutdown -- but lets leave that discussion for a ...
0
votes
1answer
23 views

Using concurrent.futures.Future with greenlets/gevent

I have a python library that performs asynchronous network via multicast which may garner replies from other services. It hides the dirty work by returning a Future which will capture a reply. I am ...
0
votes
0answers
27 views

How to use threading with a twitter tracking system?

I'm using twython to access tweets from twitters streaming api. Currently I have done so following a tutorial, by instantiating a class that gets called everytime twython returns a match with a tweet ...
1
vote
1answer
34 views

Using multithreads on a pygtk application to avoid GUI freeze

Currently developing a relativaly complex GUI using Glade for GTK+ 3 and not having problems understanding the "how to-s" for connecting buttons and signals and i have pretty good knowledge on ...
-2
votes
0answers
34 views

A wall time independent timer on python using threading on Windows platform [closed]

Is there any way to create a wall time independent timer in a thread on windows platform? I am using Virtual Machine (VM) and the code as bellow: import threading from time import sleep flag = False ...
0
votes
1answer
17 views

Why don't a singleton-shaped Thread-subclass instance's attributes of type Event return the same value?

I have this part of code: from threading import Thread, Event class mySubThread(Thread): instance = [] def __new__(cls): if not cls.instance: ...
0
votes
1answer
25 views

How can I spawn multiple tkMessageBox.showerror at the same time?

I am creating a little time management tool, using Tkinter, so I can keep on task at work. I am having trouble with one aspect that I cannot seem to get working. I'm using the error box so that it ...
1
vote
1answer
24 views

How to use the value of a global variable to determine the control flow of a function running in separate thread?

In my first project with serial communication I am trying to implement a procedure where a function in a background thread listens on the serial port for a ready signal. When a ready signal is ...
1
vote
1answer
28 views

Python multithreading Manager.list(), how to access data correctly

I'm building a class that starts up in its own process and pushes data to my database in batch sizes. This class uses a Manager.list() to get data. I figured this would be a common pattern, database ...
0
votes
0answers
16 views

How to track twitter stream and add matches to another thread - python

I'm attempting to track a particular hashtag from twitters streaming api (using Twython) which - upon a match - will execute an instruction. This illustrates my current set up ...
0
votes
1answer
24 views

Background thread behind django project

I never worked on web application/service side and not sure if this is the right way for my work: I have data collection system collecting data from serial port, and also want to present the data to ...
3
votes
1answer
31 views

Redirecting stdout and stderr to a PyQt4 QTextEdit from a secondary thread

Stack overflow. Once again, I come to you in a time of dire need, teetering precariously on the brink of insanity. This question - as may be evident from the title - is an amalgamation of several ...
0
votes
1answer
27 views

Python - parallelize a list of tasks while adding completed tasks back to the list

I have a arbitrarily large set of cpu-intensive tasks which each take ~2 seconds to complete and I want to repeat each every 5-15 seconds on a multicore machine. What would be the best way to ...
0
votes
0answers
13 views

Twython - how to search terms and place on_success values into queue

I'm new to python and am currently using Twython (Python wrapper for Twitter API) to output values on_success() By creating a class for Twython's on_success() function I have succeeded in generating ...
1
vote
5answers
48 views

Terminate Python Process in a Limited Time

Take a look at this simple python code with Process: from multiprocessing import Process import time def f(name): time.sleep(100) print 'hello', name if __name__ == '__main__': p = ...
0
votes
0answers
35 views

How to start a new thread when thread is ready ? python2.7 [duplicate]

I have a list with links, and I want to use 5 threads to scrape all links. I managed to do a thread for each link, but I will have over 1000 links, and I don't want my computer and the website to ...
1
vote
1answer
127 views

Appending values to an iterable object while web crawling in python/BeautifulSoup (also want to know about multi-threading)

I am coming here with a bug on my very first real python program (i.e. not something out of codeacademy). I am an avid user of R and I built out a bunch of web crawling/scraping tools using the XML ...

15 30 50 per page