import xlwt
from io import StringIO,BytesIO
@get('/channel/download')
def manage_download_channels():workbook = xlwt.Workbook(encoding = 'utf8')
worksheet = workbook.add_sheet('渠道明细')
worksheet.write(0,0, '渠道编码')
worksheet.write(0,1, '渠道名称')
sio = BytesIO()
workbook.save(sio)
r = web.Response()
r.content_type = 'application/vnd.ms-excel'
r.body=sio.getvalue()
return r