{"id":629,"date":"2020-02-22T17:43:56","date_gmt":"2020-02-22T09:43:56","guid":{"rendered":"http:\/\/cnliutz.uicp.io\/wordpress\/?p=629"},"modified":"2020-02-23T18:06:01","modified_gmt":"2020-02-23T10:06:01","slug":"python%e8%af%bb%e5%8f%96excel%e5%b1%95%e7%a4%ba%e5%9c%a8%e7%bd%91%e9%a1%b5%e4%b8%8a","status":"publish","type":"post","link":"http:\/\/g1n29wqq.ipyingshe.net:5347\/?p=629","title":{"rendered":"Python\u8bfb\u53d6excel\u5c55\u793a\u5728\u7f51\u9875\u4e0a"},"content":{"rendered":"\n<p>from flask import Flask<br> import pandas as pd <br>app=Flask(__name__) <br>@app.route(&#8220;\/&#8221;) <br>def  show_excel():     <br>       df=pd.read_excel(&#8220;huizong.xls&#8221;)    <br>       table_html=df.to_html()    <br>       #f in the string ,means have variable  in string    <br>        return  f&#8221;&#8217;          <br>           &lt;html>             <br>              &lt;body>                 <br>                   &lt;h1>Excel Data&lt;\/h1>                 <br>                   &lt;dev>{table_html}&lt;\/dev>            <br>             &lt;\/body>         <br>         &lt;\/html>    <br> &#8221;&#8217;<br> if __name__==&#8221;__main__&#8221;:    <br>     app.run(host=&#8221;0.0.0.0&#8243;,port=9001,debug=True)<\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"blob:http:\/\/cnliutz.uicp.io\/27703894-bb40-4609-b4f1-db3fb2462e8d\">app.py<\/a><a href=\"blob:http:\/\/cnliutz.uicp.io\/27703894-bb40-4609-b4f1-db3fb2462e8d\" class=\"wp-block-file__button\" download>\u4e0b\u8f7d<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>from flask import Flask import pandas as <span class=\"readmore\"><a href=\"http:\/\/g1n29wqq.ipyingshe.net:5347\/?p=629\">Continue Reading<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,6],"tags":[],"class_list":["post-629","post","type-post","status-publish","format-standard","hentry","category-python","category-6"],"_links":{"self":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts\/629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=629"}],"version-history":[{"count":3,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts\/629\/revisions"}],"predecessor-version":[{"id":632,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts\/629\/revisions\/632"}],"wp:attachment":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=629"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}