{"id":204026,"date":"2025-05-29T10:29:34","date_gmt":"2025-05-29T02:29:34","guid":{"rendered":"https:\/\/server.hk\/cnblog\/204026\/"},"modified":"2025-05-29T10:29:34","modified_gmt":"2025-05-29T02:29:34","slug":"%e6%97%a5-til-%e4%b8%8b%e7%9a%84%e9%9a%8f%e6%9c%ba%e5%b8%96%e5%ad%90","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/204026\/","title":{"rendered":"\u65e5 &#8211; TIL \u4e0b\u7684\u968f\u673a\u5e16\u5b50"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u65e5 &#8211; TIL \u4e0b\u7684\u968f\u673a\u5e16\u5b50<\/h1>\n<p>\u54c8\u55bd\uff01\u4eca\u5929\u5fc3\u8840\u6765\u6f6e\u7ed9\u5927\u5bb6\u5e26\u6765\u4e86<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u65e5 &#8211; TIL \u4e0b\u7684\u968f\u673a\u5e16\u5b50\u300b<\/span>\uff0c\u60f3\u5fc5\u5927\u5bb6\u5e94\u8be5\u5bf9<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u90fd\u4e0d\u964c\u751f\u5427\uff0c\u90a3\u4e48\u9605\u8bfb\u672c\u6587\u5c31\u90fd\u4e0d\u4f1a\u5f88\u56f0\u96be\uff0c\u4ee5\u4e0b\u5185\u5bb9\u4e3b\u8981\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\uff0c\u82e5\u662f\u4f60\u6b63\u5728\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\uff0c\u5343\u4e07\u522b\u9519\u8fc7\u8fd9\u7bc7\u6587\u7ae0~\u5e0c\u671b\u80fd\u5e2e\u52a9\u5230\u4f60\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241020\/17294166276714cdb3083d8.jpg\" class=\"aligncenter\"><\/p>\n<ol>\n<li>Python \u6700\u4f73\u5b9e\u8df5<\/li>\n<\/ol>\n<p><strong>1\u3002 Python \u7684\u6700\u4f73\u5b9e\u8df5<\/strong><br \/> \u9605\u8bfb Bryson Meil\u200b\u200bing \u64b0\u5199\u7684\u5173\u4e8e\u4ee5\u73b0\u4ee3\u65b9\u5f0f\u7f16\u5199 Python \u811a\u672c\u7684\u6587\u7ae0\uff0c\u5b83\u975e\u5e38\u6709\u89c1\u5730\u3002\u603b\u800c\u8a00\u4e4b\uff0c<\/p>\n<ol>\n<li>\u4f7f\u7528 pyproject.toml \u800c\u4e0d\u662frequirements.txt\u3002<\/li>\n<li>\u4f7f\u7528 uv \u8fdb\u884c\u865a\u62df\u73af\u5883\u3002<\/li>\n<li>\u4f7f\u7528\u7c7b\u578b\u63d0\u793a\u3002<\/li>\n<li>\u5c06 raises \u90e8\u5206\u6dfb\u52a0\u5230\u6587\u6863\u5b57\u7b26\u4e32\u4e2d\u3002<\/li>\n<li>\u4f7f\u7528 pydantic \u6a21\u578b\u3002<\/li>\n<li>\u4f7f\u7528\u50cf Ruff \u8fd9\u6837\u7684 linter \u548c\u683c\u5f0f\u5316\u7a0b\u5e8f\u3002<\/li>\n<li>\u4f7f\u7528 pytest\u3002<\/li>\n<li>\u4f7f\u7528 orjson \u4ee3\u66ff json\u3002<\/li>\n<li>\u59cb\u7ec8\u4f7f\u7528 fstring\u3002<\/li>\n<li>\u4f7f\u7528pathlib\u4ee3\u66ffos.path\u3002<\/li>\n<li>\u4f7f\u7528 Typer \u800c\u4e0d\u662f argparse\u3002<\/li>\n<\/ol>\n<p>\u597d\u4e86\uff0c\u672c\u6587\u5230\u6b64\u7ed3\u675f\uff0c\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u300a\u65e5 &#8211; TIL \u4e0b\u7684\u968f\u673a\u5e16\u5b50\u300b\uff0c\u5e0c\u671b\u672c\u6587\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff01\u5173\u6ce8\u516c\u4f17\u53f7\uff0c\u7ed9\u5927\u5bb6\u5206\u4eab\u66f4\u591a\u6587\u7ae0\u77e5\u8bc6\uff01<\/p>\n<p>      \u7248\u672c\u58f0\u660e \u672c\u6587\u8f6c\u8f7d\u4e8e\uff1adev.to \u5982\u6709\u4fb5\u72af\uff0c\u8bf7\u8054\u7cfb\u5220\u9664<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65e5 &#8211; TIL \u4e0b\u7684&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-204026","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/204026","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=204026"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/204026\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=204026"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=204026"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=204026"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}