{"id":379,"date":"2025-10-10T15:58:50","date_gmt":"2025-10-10T07:58:50","guid":{"rendered":"http:\/\/www.pyteam.cn\/?p=379"},"modified":"2025-10-23T15:55:57","modified_gmt":"2025-10-23T07:55:57","slug":"%e5%af%b9%e7%a7%b0%e5%9b%be%e6%a1%88%e6%a0%b8%e5%bf%83%e4%bb%a3%e7%a0%81-15-10","status":"publish","type":"post","link":"http:\/\/www.pyteam.cn\/index.php\/2025\/10\/10\/%e5%af%b9%e7%a7%b0%e5%9b%be%e6%a1%88%e6%a0%b8%e5%bf%83%e4%bb%a3%e7%a0%81-15-10\/","title":{"rendered":"\u5bf9\u79f0\u56fe\u6848\u6838\u5fc3\u4ee3\u7801 15.10"},"content":{"rendered":"\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:clamp(18px, 1.125rem, 27px);font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#90A4AE;--cbp-line-number-width:calc(2 * 0.6 * 1.125rem);line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#ededed;color:#8198a3\">Python<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#90A4AE;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly># \u989c\u8272\u6e10\u53d8\u51fd\u6570\ndef color_gradient(start_color, end_color, steps):\n    \"\"\"\u751f\u6210\u989c\u8272\u6e10\u53d8\u5e8f\u5217\"\"\"\n    # \u5b9e\u73b0\u989c\u8272\u8fc7\u6e21\u7b97\u6cd5\n    pass\n\n# \u968f\u673a\u5bf9\u79f0\u56fe\u6848\ndef random_symmetric_pattern():\n    \"\"\"\u751f\u6210\u968f\u673a\u4f46\u5bf9\u79f0\u7684\u56fe\u6848\"\"\"\n    # \u7ed3\u5408\u968f\u673a\u6027\u4e0e\u5bf9\u79f0\u6027\n    pass<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-lighter\" style=\"background-color: #FAFAFA\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #90A4AE; font-style: italic\"># \u989c\u8272\u6e10\u53d8\u51fd\u6570<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9C3EDA\">def<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #6182B8\">color_gradient<\/span><span style=\"color: #39ADB5\">(<\/span><span style=\"color: #90A4AE; font-style: italic\">start_color<\/span><span style=\"color: #39ADB5\">,<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #90A4AE; font-style: italic\">end_color<\/span><span style=\"color: #39ADB5\">,<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #90A4AE; font-style: italic\">steps<\/span><span style=\"color: #39ADB5\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">    <\/span><span style=\"color: #39ADB5; font-style: italic\">&quot;&quot;&quot;<\/span><span style=\"color: #90A4AE; font-style: italic\">\u751f\u6210\u989c\u8272\u6e10\u53d8\u5e8f\u5217<\/span><span style=\"color: #39ADB5; font-style: italic\">&quot;&quot;&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">    <\/span><span style=\"color: #90A4AE; font-style: italic\"># \u5b9e\u73b0\u989c\u8272\u8fc7\u6e21\u7b97\u6cd5<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">    <\/span><span style=\"color: #39ADB5; font-style: italic\">pass<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE; font-style: italic\"># \u968f\u673a\u5bf9\u79f0\u56fe\u6848<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9C3EDA\">def<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #6182B8\">random_symmetric_pattern<\/span><span style=\"color: #39ADB5\">():<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">    <\/span><span style=\"color: #39ADB5; font-style: italic\">&quot;&quot;&quot;<\/span><span style=\"color: #90A4AE; font-style: italic\">\u751f\u6210\u968f\u673a\u4f46\u5bf9\u79f0\u7684\u56fe\u6848<\/span><span style=\"color: #39ADB5; font-style: italic\">&quot;&quot;&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">    <\/span><span style=\"color: #90A4AE; font-style: italic\"># \u7ed3\u5408\u968f\u673a\u6027\u4e0e\u5bf9\u79f0\u6027<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">    <\/span><span style=\"color: #39ADB5; font-style: italic\">pass<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":462,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,1,5],"tags":[],"class_list":["post-379","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-24","category-1","category-5"],"views":920,"_links":{"self":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/comments?post=379"}],"version-history":[{"count":1,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/379\/revisions"}],"predecessor-version":[{"id":380,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/379\/revisions\/380"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/media\/462"}],"wp:attachment":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/media?parent=379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/categories?post=379"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/tags?post=379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}