> [cut]
> But this code ends up waiting 5 minutes for **each** thread.  that is
> not what I want. I just want to wait for 5 minutes for all threads. how
> can I do that?

I've written a little code for you using threading. Hope it will help you:

#! /usr/bin/env python
# -*- coding: utf8 -*-

import threading
import time

class MyLittleThread(threading.Thread):

  def __init__(self):
    threading.Thread.__init__(self)
        
  def run(self):
    time.sleep(5)


if __name__ == "__main__":
  # create a list of 10 MyLittleThread
  # total time to wait is 5 sec (NOT 5sec*10)
  lt = []
  for i in range(10):
    lt.append(MyLittleThread())
        
  for th in lt:
    th.start()

bye
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to