{"id":1432,"date":"2018-12-28T21:39:28","date_gmt":"2018-12-28T13:39:28","guid":{"rendered":"http:\/\/xiunian.wang\/?p=1432"},"modified":"2023-06-25T23:49:07","modified_gmt":"2023-06-25T15:49:07","slug":"python%e5%a6%82%e4%bd%95%e5%bf%ab%e9%80%9f%e9%81%8d%e5%8e%86%e5%bd%93%e5%89%8d%e6%96%87%e4%bb%b6%e5%a4%b9%e4%b8%8b%e7%9a%84%e6%89%80%e6%9c%89%e5%ad%90%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/blog.xiunian.wang\/?p=1432","title":{"rendered":"Python\u5982\u4f55\u5feb\u901f\u904d\u5386\u5f53\u524d\u6587\u4ef6\u5939\u4e0b\u7684\u6240\u6709\u5b50\u6587\u4ef6"},"content":{"rendered":"\n<p>\u7528Python \u53ef\u4ee5\u5f53\u505a\u4e00\u79cd\u8d85\u7ea7\u811a\u672c\uff0c\u7528\u6765\u5e94\u4ed8\u5404\u79cd\u5404\u6837\u7684\u4e34\u65f6\u9700\u6c42\uff0c\u5bf9\u4e8e\u8de8\u5e73\u53f0\u64cd\u4f5c\u800c\u8a00\uff0c\u975e\u5e38\u65b9\u4fbf\uff0c\u6bd4\u5982\u6279\u91cf\u91cd\u547d\u540d\uff0c\u67e5\u627e\u67d0\u4e2a\u6587\u4ef6\uff0c\u5904\u7406\u56fe\u7247\u7b49\u7b49\uff0c\u4f46\u662f\u4f53\u9a8c\u800c\u8a00\uff0c\u6700\u591a\u7684\u5de5\u4f5c\u5c31\u662f\u904d\u5386\u76ee\u5f55\u4e86\uff0c \u5199\u4e00\u4e2a\u4ee3\u7801\u5c0f\u7247\u6bb5\uff0c\u4ee5\u540e\u53ef\u4ee5\u968f\u65f6Copy\uff0c\u4e5f\u662f\u7b26\u5408Python \u4e4b\u7985\u7684\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">import glob\nfor filename in glob.iglob('**\/reg*', recursive=True):\n    os.remove(filename)\n\nimport os\nfor root,dirs,files in os.walk('.'):\n    if root,xxxxxxx<\/pre>\n\n\n\n<p>\u4e4b\u524d\u4e00\u76f4\u7528\u591a\u5c42\u5faa\u73af\uff0c\u6216\u8005\u9012\u5f52\u5b9e\u73b0\uff0c\u540e\u6765\u53d1\u73b03.5\u540e\u65b0API \u53ef\u4ee5\u975e\u5e38\u7b80\u6d01\u7684\u5b9e\u73b0\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5c31\u662f\u6700\u7b80\u5355\u7684\u5168\u5c40\u904d\u5386\u8be5\u76ee\u5f55\u4e0b\u5305\u62ec\u5b50\u76ee\u5f55\u7684\u6240\u6709\u6587\u4ef6\u7684\u4e24\u79cd\u65b9\u6cd5\uff0c\u5176\u4e2dglob.iglob \u65b9\u6cd5 \u662f glob.glob \u65b9\u6cd5\u7684\u8fed\u4ee3\u5668\u5b9e\u73b0\uff0c\u4e0d\u5360\u7528\u7cfb\u7edf\u591a\u4f59\u5185\u5b58\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7528Python \u53ef\u4ee5\u5f53\u505a\u4e00\u79cd\u8d85\u7ea7\u811a\u672c\uff0c\u7528\u6765\u5e94\u4ed8\u5404\u79cd\u5404\u6837\u7684\u4e34\u65f6\u9700\u6c42\uff0c\u5bf9\u4e8e\u8de8\u5e73\u53f0\u64cd\u4f5c\u800c\u8a00\uff0c\u975e\u5e38\u65b9\u4fbf\uff0c\u6bd4\u5982\u6279\u91cf\u91cd\u547d\u540d\uff0c\u67e5\u627e\u67d0\u4e2a\u6587\u4ef6\uff0c\u5904\u7406\u56fe\u7247\u7b49\u7b49\uff0c\u4f46\u662f\u4f53\u9a8c\u800c\u8a00\uff0c\u6700\u591a\u7684\u5de5\u4f5c\u5c31\u662f\u904d\u5386\u76ee\u5f55\u4e86\uff0c \u5199\u4e00\u4e2a\u4ee3\u7801\u5c0f\u7247\u6bb5\uff0c\u4ee5\u540e\u53ef\u4ee5\u968f\u65f6Copy\uff0c\u4e5f\u662f\u7b26\u5408Python \u4e4b\u7985\u7684\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=\/wp\/v2\/posts\/1432"}],"collection":[{"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1432"}],"version-history":[{"count":8,"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=\/wp\/v2\/posts\/1432\/revisions"}],"predecessor-version":[{"id":1731,"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=\/wp\/v2\/posts\/1432\/revisions\/1731"}],"wp:attachment":[{"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}