{"id":6527,"date":"2021-07-14T23:26:00","date_gmt":"2021-07-14T15:26:00","guid":{"rendered":"https:\/\/vip.fxxkpython.com\/?p=6527"},"modified":"2021-07-15T23:39:58","modified_gmt":"2021-07-15T15:39:58","slug":"%e4%bd%bf%e7%94%a8-python-%e4%bb%8e-0-%e5%bc%80%e5%8f%91%e5%b1%9e%e4%ba%8e%e4%bd%a0%e7%9a%84%e4%b8%aa%e4%ba%ba%e7%ae%a1%e7%90%86%e7%b3%bb%e7%bb%9f-18-%e7%af%87-%ef%bd%9c-%e4%bb%bb%e5%8a%a1%e5%88%97","status":"publish","type":"post","link":"https:\/\/vip.fxxkpython.com\/?p=6527","title":{"rendered":"\u4f7f\u7528 Python \u4ece 0 \u5f00\u53d1\u5c5e\u4e8e\u4f60\u7684\u4e2a\u4eba\u7ba1\u7406\u7cfb\u7edf 18 \u7bc7 \uff5c \u4efb\u52a1\u5217\u8868\u5c55\u793a\u4f18\u5316\u4e0e\u5206\u9875\u7684\u5b9e\u73b0"},"content":{"rendered":"\n<p>\u73b0\u5728\u6211\u4eec\u5df2\u7ecf\u5b9e\u73b0\u4e86\u4efb\u52a1\u8ba1\u5212\u529f\u80fd\u7684\u6700\u57fa\u672c\u529f\u80fd\uff0c\u63a5\u4e0b\u6765\u6211\u4eec\u6765\u4f18\u5316\u4e00\u4e0b\u4efb\u52a1\u5217\u8868\u7684\u5c55\u793a\u4ee5\u53ca\u5206\u9875\u529f\u80fd\u7684\u5b9e\u73b0\u3002<\/p>\n\n\n\n<p>\u4e4b\u524d\u6211\u4eec\u5bf9\u4e8e\u4efb\u52a1\u5217\u8868\u7684\u6570\u636e\u662f\u5728\u524d\u7aef\u505a\u5224\u65ad\uff0c\u4ece\u800c\u5c55\u793a\u300c\u5df2\u5b8c\u6210\u300d\u548c\u300c\u4efb\u52a1\u5217\u8868\u300d\uff0c\u800c\u66f4\u597d\u7684\u65b9\u5f0f\u662f\u5728\u540e\u7aef\u76f4\u63a5\u8fd4\u56de\u76f8\u5e94\u7684\u6570\u636e\u3002<\/p>\n\n\n\n<h2>\u4f18\u5316\u5c55\u793a<\/h2>\n\n\n\n<p>\u5728\u6570\u636e\u5e93\u6a21\u578b\u521b\u5efa\u7684\u65f6\u5019\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u7528\u6237\u548c\u4efb\u52a1\u6570\u636e\u8868\u8fdb\u884c\u4e86\u5173\u8054\uff0c\u90a3\u4e48\u73b0\u5728\u8981\u901a\u8fc7 is_done \u6765\u83b7\u53d6\u4efb\u52a1\u5217\u8868\u6570\u636e\u5c31\u53ef\u4ee5\u8fd9\u6837\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;wpum_restrict_type&quot;:&quot;wpum_restrict_type_state&quot;,&quot;wpum_hide_state_in&quot;:false,&quot;wpum_hide_state_out&quot;:false,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">\n@app.route('\/todolist\/&lt;int:is_done&gt;\/', methods=['GET', 'POST'])\ndef todolist(is_done):\n    user = User.query.filter_by(id=session['user_id']).first_or_404()\n    todos = Todo.query.with_parent(user).filter_by(is_done=is_done)\n<\/pre><\/div>\n\n\n\n<p>\u5728\u524d\u7aef html \u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u4efb\u52a1\u7684\u65f6\u95f4\u52a0\u4e0a\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;wpum_restrict_type&quot;:&quot;wpum_restrict_type_state&quot;,&quot;wpum_hide_state_in&quot;:false,&quot;wpum_hide_state_out&quot;:false,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">\n&lt;div class=&quot;col&quot;&gt;\n    &lt;div class=&quot;h5 mb-0 font-weight-bold text-gray-800&quot;&gt;{{ todo.description }}&lt;\/div&gt;\n    &lt;div class=&quot;h8 mb-0 text-gray-600&quot;&gt;{{ todo.create_time }}&lt;\/div&gt;\n&lt;\/div&gt;\n<\/pre><\/div>\n\n\n\n<p>\u8fd9\u6837\u5c31\u663e\u5f97\u6e05\u6670\u4e00\u4e9b\u4e86\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"756\" height=\"627\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2021\/07\/\u622a\u5c4f2021-07-15-\u4e0b\u53487.53.26-1.png\" alt=\"\" class=\"wp-image-6529\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2021\/07\/\u622a\u5c4f2021-07-15-\u4e0b\u53487.53.26-1.png 756w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2021\/07\/\u622a\u5c4f2021-07-15-\u4e0b\u53487.53.26-1-300x249.png 300w\" sizes=\"(max-width: 756px) 100vw, 756px\" \/><\/figure><\/div>\n\n\n\n<p>\u4f46\u5728\u5df2\u5b8c\u6210\u5217\u8868\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u505a\u4e00\u4e2a\u5224\u65ad\uff0c\u663e\u793a\u5b8c\u6210\u65f6\u95f4\uff0c\u5e76\u4e14\u628a\u6587\u5b57\u52a0\u4e0a del \u6837\u5f0f\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;wpum_restrict_type&quot;:&quot;wpum_restrict_type_state&quot;,&quot;wpum_hide_state_in&quot;:false,&quot;wpum_hide_state_out&quot;:false,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">\n{% elif is_done==1 %}\n&lt;div class=&quot;col&quot;&gt;\n    &lt;div class=&quot;h5 mb-0 font-weight-bold text-gray-800&quot;&gt;&lt;del&gt;{{ todo.description }}&lt;\/del&gt;&lt;\/div&gt;\n    &lt;div class=&quot;h8 mb-0 text-gray-600&quot;&gt;{{ todo.done_time }}&lt;\/div&gt;\n&lt;\/div&gt;\n&lt;div class=&quot;col-auto&quot;&gt;\n    &lt;input type=&quot;checkbox&quot; data-todo-id=&quot;{{ todo.id }}&quot; class=&quot;btn-check&quot; id=&quot;btn-check-outlined&quot;\n           autocomplete=&quot;off&quot; checked&gt;\n&lt;\/div&gt;\n{% endif %}\n<\/pre><\/div>\n\n\n\n<p>\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"772\" height=\"747\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2021\/07\/\u622a\u5c4f2021-07-15-\u4e0b\u53487.59.14.png\" alt=\"\" class=\"wp-image-6530\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2021\/07\/\u622a\u5c4f2021-07-15-\u4e0b\u53487.59.14.png 772w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2021\/07\/\u622a\u5c4f2021-07-15-\u4e0b\u53487.59.14-300x290.png 300w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2021\/07\/\u622a\u5c4f2021-07-15-\u4e0b\u53487.59.14-768x743.png 768w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2021\/07\/\u622a\u5c4f2021-07-15-\u4e0b\u53487.59.14-769x744.png 769w\" sizes=\"(max-width: 772px) 100vw, 772px\" \/><\/figure><\/div>\n\n\n\n<h2>\u5206\u9875\u529f\u80fd<\/h2>\n\n\n\n<p>\u90a3\u4e48\u5982\u679c\u7528\u6237\u6dfb\u52a0\u4e86\u5f88\u591a\u4efb\u52a1\uff0c\u8fd9\u65f6\u5019\u603b\u4e0d\u80fd\u8ba9\u7528\u6237\u4e00\u76f4\u7528\u9f20\u6807\u6eda\u52a8\u5427\uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u5728\u9875\u9762\u4e2d\u6dfb\u52a0\u5206\u9875\u529f\u80fd\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u6211\u4eec\u53ef\u4ee5\u5728<div style=\"text-align:center;border:1px dashed #FF9A9A;padding:8px;margin:10px auto;color:#FF6666;\">\u672c\u6587\u9690\u85cf\u5185\u5bb9 <a href=\"https:\/\/vip.fxxkpython.com\/wp-login.php?redirect_to=https%3A%2F%2Fvip.fxxkpython.com%2F%3Fp%3D6527\">\u767b\u9646<\/a> \u540e\u624d\u53ef\u4ee5\u6d4f\u89c8<\/div>\u8fd9\u91cc\u4e3b\u8981\u662f\u8bb2\u9875\u6570\u548c\u4efb\u52a1\u72b6\u6001\u4f20\u8fc7\u53bb\u540e\u7aef\u83b7\u53d6\u6570\u636e\u3002<\/p>\n\n\n\n<p>\u8fd0\u884c\u8d77\u6765\u5427\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"1244\" height=\"824\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2021\/07\/11.gif\" alt=\"\" class=\"wp-image-6533\"\/><\/figure><\/div>\n\n\n\n<p>\u53ef\u4ee5\u770b\u5230\uff0c\u6211\u4eec\u7684\u5206\u9875\u529f\u80fd\u5c31\u5b9e\u73b0\u5566\uff01\u4e0b\u56de\u89c1\uff0cpeace\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73b0\u5728\u6211\u4eec\u5df2\u7ecf\u5b9e\u73b0\u4e86\u4efb\u52a1\u8ba1\u5212\u529f\u80fd\u7684\u6700\u57fa\u672c\u529f\u80fd\uff0c\u63a5\u4e0b\u6765\u6211\u4eec\u6765\u4f18\u5316\u4e00\u4e0b\u4efb\u52a1\u5217\u8868\u7684\u5c55\u793a\u4ee5\u53ca\u5206\u9875\u529f\u80fd\u7684\u5b9e\u73b0\u3002 \u4e4b\u524d\u6211\u4eec\u5bf9\u4e8e\u4efb\u52a1\u5217\u8868\u7684\u6570\u636e\u662f\u5728\u524d\u7aef\u505a\u5224\u65ad\uff0c\u4ece\u800c\u5c55\u793a\u300c\u5df2\u5b8c\u6210\u300d\u548c\u300c\u4efb\u52a1\u5217\u8868\u300d\uff0c\u800c\u66f4\u597d\u7684\u65b9\u5f0f\u662f\u5728\u540e\u7aef\u76f4\u63a5\u8fd4\u56de\u76f8\u5e94\u7684\u6570\u636e\u3002 \u4f18\u5316\u5c55\u793a \u5728\u6570\u636e\u5e93\u6a21\u578b\u521b\u5efa\u7684\u65f6\u5019&hellip;<\/p>\n","protected":false},"author":1,"featured_media":6531,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[99],"tags":[607],"_links":{"self":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/6527"}],"collection":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6527"}],"version-history":[{"count":1,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/6527\/revisions"}],"predecessor-version":[{"id":6534,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/6527\/revisions\/6534"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/media\/6531"}],"wp:attachment":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}