Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from __future__ import with_statement
- def sendfile(path, chunk_size=264704):
- """Poor man's sendfile for use with WSGI."""
- with open(path, 'r') as fh:
- while True:
- chunk = fh.read(chunk_size)
- if chunk == '':
- break
- yield chunk
Add Comment
Please, Sign In to add comment