Quanlse/QTask.py
def _downloadToFile(url, localFile):
    """
    Download from a url to a local file
    """

    total = 0
    with requests.get(url, stream=True) as req:
        req.raise_for_status()
        with open(localFile, 'wb') as fObj:
            for chunk in req.iter_content(chunk_size=8192):
                if chunk:  # filter out keep-alive new chunks
                    fObj.write(chunk)
                    total += len(chunk)
                    # f.flush()
    return os.path.realpath(localFile), total

    Download from a url to a local file
    
Download from a url to a local file
Download from a url to a local file
def _downloadToFile(url, localFile):
    total = 0
    with requests.get(url, stream=True) as req:
        req.raise_for_status()
        with open(localFile, 'wb') as fObj:
            for chunk in req.iter_content(chunk_size=8192):
                if chunk:  
                    fObj.write(chunk)
                    total += len(chunk)
    return os.path.realpath(localFile), total
def _downloadToFile ( url , localFile ) : total = 0 with requests . get ( url , stream = True ) as req : req . raise_for_status ( ) with open ( localFile , 'wb' ) as fObj : for chunk in req . iter_content ( chunk_size = 8192 ) : if chunk : fObj . write ( chunk ) total += len ( chunk ) return os . path . realpath ( localFile ) , total
Download from a url to a local file
Download from a url to a local file
"""
    Download from a url to a local file
    """ # filter out keep-alive new chunks # f.flush()
url
localFile