pluring 0 Newbie Poster

I use url retrive and reporthook to update wx.gauge. The problem i have is that after just a few updates it stops.

I use a simple threading for the downloading process and guess thats the problem?

def trad():
    thread.start_new_thread(download, ())

def download():
    for url in open('url', 'r').readlines():
        url = string.strip(url)
        file = url[url.rindex('/')+1:]
        dst = "files/%s" % file
        if sys.stdout.isatty():
            frame_1.t_status.SetValue(file)
            urllib.urlretrieve(url, dst, reporthook=dlprogress)

def dlprogress(count, blockSize, totalSize):
     percent = int(count*blockSize*100/totalSize)
     frame_1.gauge.SetValue(percent)
     print frame_1.gauge.GetValue()

/Pluring

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.