[Tkinter-discuss] Fw: Tkinter's createfilehandler - attempt to run parallel threads
sxn02 at yahoo.com
Thu Oct 12 17:45:19 CEST 2006
This question was posted on python-list at python.org, but found no answer there. Maybe here I'll be lucky...
----- Forwarded Message ----
From: Sorin Schwimmer <sxn02 at yahoo.com>
To: python-list at python.org
Sent: Thursday, July 27, 2006 1:20:21 PM
Subject: Tkinter's createfilehandler - attempt to run parallel threads
The project that I'm working for runs a PostgreSQL database on a remote machine and several Python clients all over the place. The objects usualy have in their constructor a query to the database. As the query is executed on the remote machine, I'm trying to be fancy and execute it while building my Tkinter interface.
The following code illustrates what I'm attempting to do:
from pg import DB
from Tkinter import *
print 'Executing __init__'
db=DB('design',host='xx.xx.xx.xx',user='yyyy') # relevant IP and user needed
Label(r,text='Let\'s see the results').grid()
print '__init__ done'
print '->Executing th'
s.r=db.query('select * from customers limit 10').getresult() # some query
print '->th done'
for i in s.r:
The output is:Executing
and it basicly shows that everything happens sequentialy. Pressing the button gives the expected result, so everything is correct. How can I obtain the desired parallelism?
Groups are talking. We´re listening. Check out the handy changes to Yahoo! Groups.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tkinter-discuss