[b]"What's the best way to download a file to disk using Python3?"[/b] or [b]"How can I download a file to disk wi

18 Replies, 549 Views

urllib works too if you don’t wanna install extra stuff. Here’s how:

```python
from urllib.request import urlretrieve

url = "https://example.com/file.zip"
urlretrieve(url, "file.zip")
```

Super short, but less flexible than `requests`. Also, urllib might throw weird errors on redirects or timeouts, so be ready for that.

Messages In This Thread



Users browsing this thread: 2 Guest(s)