{"id":160443,"date":"2020-09-26T06:22:09","date_gmt":"2020-09-25T22:22:09","guid":{"rendered":"http:\/\/4563.org\/?p=160443"},"modified":"2020-09-27T12:18:28","modified_gmt":"2020-09-27T04:18:28","slug":"python-%e5%a6%82%e4%bd%95%e6%98%be%e7%a4%ba%e5%80%92%e8%ae%a1%e6%97%b6%ef%bc%88%e5%90%8c%e4%b8%80%e8%a1%8c%e8%87%aa%e5%8a%a8%e6%9b%b4%e6%96%b0%ef%bc%89%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=160443","title":{"rendered":"Python \u5982\u4f55\u663e\u793a\u5012\u8ba1\u65f6\uff08\u540c\u4e00\u884c\u81ea\u52a8\u66f4\u65b0\uff09\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Python \u5982\u4f55\u663e\u793a\u5012\u8ba1\u65f6\uff08\u540c\u4e00\u884c\u81ea\u52a8\u66f4\u65b0\uff09\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhybzc <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u7c7b\u4f3c\u4e8e windows \u7684 cmd \u547d\u4ee4\u7684 timeout \u547d\u4ee4\uff0c\u6bd4\u5982\u5728 cmd \u7a97\u53e3\u8f93\u5165\u201ctimeout 10\u201d\u5c31\u4f1a\u663e\u793a 10 \u79d2\u7684\u5012\u8ba1\u65f6(\u662f\u5728\u540c\u4e00\u884c\u66f4\u65b0\uff0c\u4e0d\u4f1a\u6bcf 1 \u79d2\u5c31\u663e\u793a\u4e00\u4e2a\u65b0\u884c)\u3002\u5982\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/09\/O1CN01ojH2Tm1mwI5EDEAPp_78065018.png\" alt=\"Python \u5982\u4f55\u663e\u793a\u5012\u8ba1\u65f6\uff08\u540c\u4e00\u884c\u81ea\u52a8\u66f4\u65b0\uff09\uff1f\" \/><\/p>\n<p>\u76f4\u63a5\u5728 python \u4e2d\u8c03\u7528 os.system(&#8216;timeout 10&#8217;)\u7528\u5728\u591a\u7ebf\u7a0b\u6216\u591a\u8fdb\u7a0b\u4e2d\u4f1a\u6709 bug,\u6240\u4ee5\u5e0c\u671b\u6709 python \u539f\u751f\u7684\u65b9\u5f0f\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3468325\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zmxnv123 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u9000\u683c\u7b26\u4e86\u89e3\u4e0b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3468326\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : keith1126 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             r                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3468327\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jackmod <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             print(f&#8217;wait {sec} seconds&#8217;, end = &#8216;r&#8217;)                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3468328\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : zhybzc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             import time<br \/>for i in range(10,0,-1): <br \/> print(&#8216;\u8fd8\u9700\u7b49\u5f85%s \u79d2&#8217; % i, end = &#8216;r&#8217;)<br \/> time.sleep(1)<br \/>print(&#8216;\u8fd8\u9700\u7b49\u5f85 0 \u79d2&#8217;,end = &#8216;r&#8217;)                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3468329\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : zhybzc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             import time<br \/>for i in range(10,0,-1): <br \/>[\u7f29\u8fdb]print(&#8216;\u8fd8\u9700\u7b49\u5f85%s \u79d2&#8217; % i, end = &#8216;r&#8217;)<br \/>[\u7f29\u8fdb]time.sleep(1)<br \/>print(&#8216;\u8fd8\u9700\u7b49\u5f85 0 \u79d2&#8217;,end = &#8216;r&#8217;)                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Python \u5982\u4f55\u663e\u793a\u5012\u8ba1\u65f6\uff08\u540c\u4e00&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\/160443"}],"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=160443"}],"version-history":[{"count":1,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/160443\/revisions"}],"predecessor-version":[{"id":160445,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/160443\/revisions\/160445"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=160443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=160443"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=160443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}