From: Jonathan E. <jon...@ca...> - 2005-06-07 02:46:00
|
On Mon, 06 Jun 2005 22:02:04 -0400, "Jonathan Taylor" <jon...@ut...> said: > I was thinking of using pool module. I tried to do something like: > > pool["process"] = os.popen("/some/path/to/long.py") > > but it seems the page waits for long.py to finish. I was hoping to have > it just display its progress. > > :( > > Any ideas? This sort of thing is tricky if you haven't done it before. In my experience the best cross-platform way to do this sort of thing is with threads. (Thread A runs the process and updates a shared variable, like the Spyce pool; thread B reads the progress from the pool.) www/index.spy does this when it autogenerates the documentation on a fresh install. You can try to avoid extra threads by using select to make sure your reads won't block, but ymmv especially on win32. -Jonathan |