What's the best way to use python wget for downloading files? or How can I implement python wget in m

20 Replies, 1164 Views

Honestly, python wget is meh. `requests` is way more reliable, and you can even add progress bars with `clint`.

```python
from clint.textui import progress

r = requests.get(url, stream=True)
with open('file.ext', 'wb') as f:
for chunk in progress.bar(r.iter_content(chunk_size=1024)):
f.write(chunk)
```

Way less hair-pulling.

Messages In This Thread



Users browsing this thread: 1 Guest(s)