请问怎么实现提供流文件下载呢?

怎么样才能用python 和cgi模块提供流模式的文件下载呢?

类似于.net的这种:

_Response.AddHeader("Connection", "Keep-Alive";
_Response.ContentType = "application/octet-stream";
_Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(_fileName, System.Text.Encoding.UTF);

_Response.BinaryWrite(br.ReadBytes(pack));