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.T hread):
def __init__(self):
threading.Threa d.__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.Pope n(self.cmd.spli t())
def run(self):
self.download()
def main():
w = vid()
w.start()
w.join()
(B) =============== =============== ==============
class vid(threading.T hread):
def __init__(self):
threading.Threa d.__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.Pope n(self.cmd.spli t(), stderr=subproce ss.PIPE)
def run(self):
self.download()
self.child.stde rr.readlines()
def main():
w = vid()
w.start()
w.join()
=============== =============== ==============
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.T hread):
def __init__(self):
threading.Threa d.__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.Pope n(self.cmd.spli t())
def run(self):
self.download()
def main():
w = vid()
w.start()
w.join()
(B) =============== =============== ==============
class vid(threading.T hread):
def __init__(self):
threading.Threa d.__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.Pope n(self.cmd.spli t(), stderr=subproce ss.PIPE)
def run(self):
self.download()
self.child.stde rr.readlines()
def main():
w = vid()
w.start()
w.join()
=============== =============== ==============
Comment