Threading issue (using alsaaudio)

2011-12-19 Thread Jérôme
Hi all. I am currently learning python (and pyGTK) and I'm having a hard time understanding some threading stuff. I'm writing here hoping I can get - pointers to some documentation that could help me - a lead concerning the specific problem described in the message - a hint about which librar

Re: Tkinter/threading issue

2010-08-15 Thread Jerrad Genson
Well, I figured it out. Thanks anyway for your help. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter/threading issue

2010-08-15 Thread Jerrad Genson
def check_message(self, spawn=True): '''Method for pulling message from server process.''' if spawn: self.pid2 = os.fork() if self.pid2 == 0: if verbose: print('message checker initialized') # repeat message check forever while True:

Re: Tkinter/threading issue

2010-08-15 Thread Jerrad Genson
class MessageServer: '''Creates a message server object that listens for textual information and sends it back to the main program. Intended to be spawned as a separate process. ''' def __init__(self, port_number, server_send, server_receive): '''@param server_

Re: Tkinter/threading issue

2010-08-15 Thread Jerrad Genson
Thank you for the reply. When I said "TCP/IP" protocol, what I meant was this: http://en.wikipedia.org/wiki/Internet_Protocol_Suite. The reason the server is in a separate process is because it needs to continually be listening for network packets, which would disrupt the GUI. In any case, that pa

Re: Tkinter/threading issue

2010-08-15 Thread Thomas Jollans
On Sunday 15 August 2010, it occurred to Jerrad Genson to exclaim: > Hello, > > I'm learning Tkinter, and I have an issue that I'd appreciate help > with. I have a program that initializes a GUI (I'll call this the "GUI > process"), then spawns another process that listens on a network via > the T

Re: Tkinter/threading issue

2010-08-15 Thread Jerrad Genson
I should also mention that I'm running Ubuntu 10.04 and Python 2.6.5. -- http://mail.python.org/mailman/listinfo/python-list

Tkinter/threading issue

2010-08-15 Thread Jerrad Genson
Hello, I'm learning Tkinter, and I have an issue that I'd appreciate help with. I have a program that initializes a GUI (I'll call this the "GUI process"), then spawns another process that listens on a network via the TCP/IP protocol for incoming strings (I'll call this the "server process"). Ever

Re: Threading issue with SQLite

2010-02-02 Thread Alan Harris-Reid
Many thanks to all who replied to my questions re. SQLite connections, cursors and threading. Looks like I have got some reading to do regarding connection pooling and a decent SQLite ORM package. Does anyone know of any which are Python 3 compatible? Many thanks, Alanj -- http://mail.pyth

Re: Threading issue with SQLite

2010-01-30 Thread John Nagle
Jonathan Gardner wrote: On Jan 29, 8:37 am, Alan Harris-Reid wrote: Questions... 1. Is there a large overhead in opening a new SQLite connection for each thread (ie. within each method)? Suggestion: Use something like SQLAlchemy to manage you DB interactions. One day, you'll move away from

Re: Threading issue with SQLite

2010-01-29 Thread Stephen Hansen
On Fri, Jan 29, 2010 at 8:37 AM, Alan Harris-Reid < aharrisr...@googlemail.com> wrote: > Hi, > > I am creating a web application (using Python 3.1 and CherryPy 3.2) where a > SQLite connection and cursor object are created using the following code > (simplified from the original): > > class MainSi

Re: Threading issue with SQLite

2010-01-29 Thread Jonathan Gardner
On Jan 29, 8:37 am, Alan Harris-Reid wrote: > > Questions... > 1.  Is there a large overhead in opening a new SQLite connection for > each thread (ie. within each method)? Yes, but not as bad as some other DBs. > 2.  Is there any way to use the same connection for the whole class (or > should I

Threading issue with SQLite

2010-01-29 Thread Alan Harris-Reid
Hi, I am creating a web application (using Python 3.1 and CherryPy 3.2) where a SQLite connection and cursor object are created using the following code (simplified from the original): class MainSite: con = sqlite.connect('MyDatabase.db') cursor = con.cursor() def index_page():

threading issue

2009-05-17 Thread anusha k
hi, i am using pygtk,glade in the front end and postgresql,python-twisted (xmlrpc) as the back end.My issue is i am trying to add the progress bar in my application but when the progress bar comes up it is blocking the backend process.So i started using threading in my application.But when i added

Re: Text widget updates only after calling method exits (threading issue?)

2007-12-12 Thread mariox19
*** SOLVED *** Thanks, Eric. I've had luck with code along these lines: # 1. Assume Text widget as instance variable: textView # 2. Assume button with method, 'start', bound to it def start(self, event=None): """ Starts the demo. """ # Print A-Z to wid

Re: Text widget updates only after calling method exits (threading issue?)

2007-12-12 Thread Eric Brunel
On Wed, 12 Dec 2007 02:58:37 +0100, mariox19 <[EMAIL PROTECTED]> wrote: > Are Tkinter widgets running on their own thread? No. And usually, GUI toolkits and threads don't mix well... > If I try to make a simple application that will print the letters A to > Z to a Tkinter Text widget, and I spac

Re: Text widget updates only after calling method exits (threading issue?)

2007-12-12 Thread Marc 'BlackJack' Rintsch
On Tue, 11 Dec 2007 17:58:37 -0800, mariox19 wrote: > If I am supposed to send messages to Tkinter objects only from the > main thread, how can I get the letters to appear 1 per second? Take a look at the `after()` method on widgets. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.

Text widget updates only after calling method exits (threading issue?)

2007-12-11 Thread mariox19
Are Tkinter widgets running on their own thread? If I try to make a simple application that will print the letters A to Z to a Tkinter Text widget, and I space the printing of each letter by 1 second, it seems no text will appear in the Text widget until the method exits. Take a look at this snip

Re: wxPython and threading issue

2006-09-29 Thread [EMAIL PROTECTED]
Patrick Smith wrote: > > Well, the problem is that you can't simply kill a thread--it shares > > memory with other threads that it could be leaving in an inconsistent > > state. Imagine that it was, say, holding a lock when it was forceably > > killed. Now any other thread that tries to acquire t

Re: wxPython and threading issue

2006-09-29 Thread Patrick Smith
"Nick Vatamaniuc" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If your thread is long running and it is not possible to easily set a > flag for it to check and bail out, then how does it display the > progress in the progress dialog. How often does that get updated? If > the progr

Re: wxPython and threading issue

2006-09-29 Thread Patrick Smith
> Well, the problem is that you can't simply kill a thread--it shares > memory with other threads that it could be leaving in an inconsistent > state. Imagine that it was, say, holding a lock when it was forceably > killed. Now any other thread that tries to acquire that lock will > block forever

Re: wxPython and threading issue

2006-09-29 Thread Nick Vatamaniuc
If your thread is long running and it is not possible to easily set a flag for it to check and bail out, then how does it display the progress in the progress dialog. How often does that get updated? If the progress dialog is updated often, then at each update have the thread check a self.please_di

Re: wxPython and threading issue

2006-09-29 Thread [EMAIL PROTECTED]
Patrick Smith wrote: > Hi, > Thanks for your reply. > > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > [Re: cancelling a worker thread from the GUI thread] > > > > Have the main thread set a flag telling the worker thread to exit, and > > have the worker thread check that periodi

Re: wxPython and threading issue

2006-09-28 Thread Steve Holden
Patrick Smith wrote: > Hi, > Thanks for your reply. > > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>Patrick Smith wrote: >> >>>Hi, >>>I'm hoping someone here will be able to help as I've been struggling > > with > >>>this problem for a few days now. >>> >>>I'm working on a

Re: wxPython and threading issue

2006-09-28 Thread Patrick Smith
Hi, Thanks for your reply. <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Patrick Smith wrote: > > Hi, > > I'm hoping someone here will be able to help as I've been struggling with > > this problem for a few days now. > > > > I'm working on an application that is creating a Progress

Re: wxPython and threading issue

2006-09-28 Thread [EMAIL PROTECTED]
Patrick Smith wrote: > Hi, > I'm hoping someone here will be able to help as I've been struggling with > this problem for a few days now. > > I'm working on an application that is creating a ProgressDialog, and then > creating a thread that runs a function from another module in the program. > > Th

wxPython and threading issue

2006-09-28 Thread Patrick Smith
Hi, I'm hoping someone here will be able to help as I've been struggling with this problem for a few days now. I'm working on an application that is creating a ProgressDialog, and then creating a thread that runs a function from another module in the program. The problem is, when the cancel butto