Hi

it seems the script (A) finishes before the downloading ends, and the
(B) version doesn't (wanted behavior) ... this is unexpected. What
happens ?


(A) ============================================
class vid(threading.Thread):
        def __init__(self):
                threading.Thread.__init__(self)
        def download(self):
                self.cmd = 'wget
ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/7.0/7.0-RELEASE-i386-bootonly.iso'
                self.child = subprocess.Popen(self.cmd.split())
        def run(self):
                self.download()

def main():
        w = vid()
        w.start()
        w.join()

(B) ============================================
class vid(threading.Thread):
        def __init__(self):
                threading.Thread.__init__(self)
        def download(self):
                self.cmd = 'wget
ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/7.0/7.0-RELEASE-i386-bootonly.iso'
                self.child = subprocess.Popen(self.cmd.split(), 
stderr=subprocess.PIPE)
        def run(self):
                self.download()
                self.child.stderr.readlines()

def main():
        w = vid()
        w.start()
        w.join()
============================================
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to