Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Streaming a `requests` response as a file
- In many applications, you'd like to access a `requests` response as a file-like object, simply having `.read()`, `.seek()`, and `.tell()` as normal. Especially when you only want to *partially* download a file, it'd be extra convenient if you could use a normal file interface for it, loading as needed.
- This is a wrapper class for doing that. Only bytes you request will be loaded - see the example in the gist itself.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement