{"id":151256,"date":"2020-09-01T01:22:07","date_gmt":"2020-08-31T17:22:07","guid":{"rendered":"http:\/\/4563.org\/?p=151256"},"modified":"2020-09-01T01:22:07","modified_gmt":"2020-08-31T17:22:07","slug":"%e6%b1%82-aiohttp-%e5%90%8e%e7%ab%af-%e7%9b%b4%e6%8e%a5%e7%94%9f%e6%88%90-exl-%e4%b8%8b%e8%bd%bd-%e7%9a%84-demo-%ef%bc%8c%e5%ae%9e%e5%9c%a8%e6%89%be%e4%b8%8d%e5%88%b0%e6%9d%90%e6%96%99%e3%80%82","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=151256","title":{"rendered":"\u6c42 aiohttp \u540e\u7aef \u76f4\u63a5\u751f\u6210 exl \u4e0b\u8f7d \u7684 demo \uff0c\u5b9e\u5728\u627e\u4e0d\u5230\u6750\u6599\u3002\u3002"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6c42 aiohttp \u540e\u7aef \u76f4\u63a5\u751f\u6210 exl \u4e0b\u8f7d \u7684 demo \uff0c\u5b9e\u5728\u627e\u4e0d\u5230\u6750\u6599\u3002\u3002               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : naldo0193 <\/span>  <span><i><\/i> 25<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6c42 aiohttp \u540e\u7aef \u76f4\u63a5\u751f\u6210 xlsx \u548c\u54cd\u5e94\u4e0b\u8f7d\u7684 demo\uff0c\u5b9e\u5728\u627e\u4e0d\u5230\u6559\u7a0b\u3002\u3002<\/p>\n<p>\u53e6\u5916\u8bf7\u95ee\u5404\u4f4d\u5bf9\u4e8e\u81ea\u5df1\u4e0d\u719f\u6089\u5e93\uff0c\u6709\u4ec0\u4e48\u6280\u5de7\u80fd\u8f83\u7cfb\u7edf\u4e86\u89e3\u8fd9\u4e2a\u5e93\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>11<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2983029\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : supermoonie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             aio \u4e0d\u662f windows \u73a9\u7684\u8f6c\u5417\uff0clinux \u670d\u52a1\u5668\u5927\u591a\u662f nio \u5427\uff0c\u4e0d\u719f\u6089\u7684\u8bdd\u5c31\u627e\u627e\u4e66\u7cfb\u7edf\u770b\u4e0b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2983030\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qile1 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             datatable \u6709\u4e2a\u5bfc\u51fa excel \u548c\u590d\u5236\u53ca\u6253\u5370\u7684\u6309\u94ae\uff0c\u4f60\u53c2\u8003\u4e0b\u770b\u662f\u5426\u7c7b\u4f3c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2983031\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \uff1f\u8fd9\u8ddf\u6846\u67b6\u6ca1\u5173\u7cfb\uff0c\u6284\u8d77 openxlsx \u4e00\u628a\u68ad\u7136\u540e response \u5199 bytes \u5c31\u884c\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2983032\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Vegetable <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u641e\u4e0d\u61c2\u4f60\u4eec\u4e3a\u4ec0\u4e48\u7528 aiohttp \u76f4\u63a5\u505a server&#8230;<br \/>\u4f60\u7684\u91cd\u70b9\u5e94\u8be5\u662f\u600e\u4e48\u751f\u6210\u4e00\u4e2a excel \u4fdd\u5b58\u5728\u5185\u5b58\u4e2d\u3002\u8fd9\u4e2a\u8981\u770b\u4f60\u4ec0\u4e48\u5e93,\u4ee5 openpyxl \u4e3a\u4f8b<br \/>\u6b63\u5e38\u65f6 wb.save(filename)<br \/>\u4f60\u7528<br \/>body = BytesIO()<br \/>wb.save(body)<br \/>\u5c06 xls \u53d8\u6210\u4e00\u4e2a\u5b57\u8282\u7801\uff0c\u5728\u628a\u8fd9\u4e2a\u5b57\u8282\u7801\u8fd4\u56de\uff0c\u8bbe\u7f6e\u597d\u6587\u4ef6\u540d\u548c mimetype \u5c31\u884c\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2983033\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : so1n <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @supermoonie \u5728 linux \u7528 epoll \u5728 win \u597d\u50cf\u662f select                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2983034\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fasionchan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             openpyxl\uff0c\u8fd9\u6709\u7bc7\u5165\u95e8\u6587\u7ae0\uff1a https:\/\/python.fasionchan.com\/zh_CN\/latest\/libs\/openpyxl.html                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2983035\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : supermoonie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @so1n win \u7684 aio \u652f\u6301\u8d70\u5728\u4e86\u524d\u9762                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2983036\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : boolking <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             xlsx \u5c31\u662f\u4e00\u4e2a zip \u6587\u4ef6\uff0c\u91cc\u9762\u90fd\u662f xml\uff0c\u5927\u90e8\u5206 xml \u53ef\u4ee5\u7528\u9ed8\u8ba4\u503c\uff0csheet1.xml \u653e\u5de5\u4f5c\u7c3f 1\uff0c\u53ef\u4ee5\u6d41\u5f0f\u751f\u6210\uff0c\u4e0d\u9700\u8981\u4e34\u65f6\u6587\u4ef6\u3002\u6211\u5199\u7684\u4e00\u4e2a go \u7248\u672c\u7684\uff1a https:\/\/gist.github.com\/boolking\/0c920aab2dc6713150dab35cd02e3367 <button onclick=\"lazyGist(this)\">\u00a0\u663e\u793a Gist \u4ee3\u7801\u00a0<\/button> <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2983037\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : boolking <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             python \u6807\u51c6\u5e93\u7684 zipfile \u4e0d\u652f\u6301\u6d41\u5f0f\u751f\u6210\uff0c\u53ef\u4ee5\u7528\uff1a<br \/>https:\/\/github.com\/arjan-s\/python-zipstream<br \/>https:\/\/github.com\/kbbdy\/zipstream                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2983038\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : rockivy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @boolking \u5b66\u4e60\u4e86\uff0c\u591a\u8c22\uff01                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2983039\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fareer <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6709\u507f\u63d0\u4f9b\u6e90\u7801                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6c42 aiohttp \u540e\u7aef \u76f4\u63a5\u751f\u6210&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/151256"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=151256"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/151256\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=151256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=151256"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=151256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}