Usually the chunk size is much smaller at 1024.
If you're going to use a massive chunk size like that you might as well leave out chunks and use less code.
r = requests.get(url) with open("wind-turbine.jpg", "wb") as f: f.write(r.content)
jdhao.github.io/2020/06/17/downloa...
Using with block instead of open and close is also safer and more common.
with
Would also love to see 4 space indention instead of 2 for Python code, to match the recommended style.
Fixed! Thanks. I didn't proofread much before upload :)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Usually the chunk size is much smaller at 1024.
If you're going to use a massive chunk size like that you might as well leave out chunks and use less code.
jdhao.github.io/2020/06/17/downloa...
Using
withblock instead of open and close is also safer and more common.Would also love to see 4 space indention instead of 2 for Python code, to match the recommended style.
Fixed! Thanks. I didn't proofread much before upload :)