What methods does python have to deal with a large number of file downloads?

there are hundreds of files. But none of them are big, and the largest ones are only a few megabytes

.

I use pycurl to download.

I put the download address on the list.

take out the first download, wait for it, and then take the second one.

but the question is, with hundreds of download connections, how can pycurl determine that the current file has been downloaded and then move on to the next one.


but the question is, with hundreds of download connections, how can pycurl determine that the current file has been downloaded and then move on to the next one.

pycurl understands the HTTP protocol, so you don't have to worry about it.


use tomorrow to execute concurrently

from tomorrow import threads

@threads(10)
def get_data(url):
    ...
    return res
    
urls = [...]

res = [get_data(url) for url in urls]
Something like that. If you don't give me an example, I'll just demonstrate it. How to use it can be seen on the official website.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bede66-31bb8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bede66-31bb8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?