{"id":30,"date":"2024-08-13T11:50:32","date_gmt":"2024-08-13T03:50:32","guid":{"rendered":"http:\/\/8.134.236.44\/wordpress\/?p=30"},"modified":"2024-08-13T11:50:46","modified_gmt":"2024-08-13T03:50:46","slug":"%e8%af%ad%e6%b3%95%e8%a7%84%e8%8c%83","status":"publish","type":"post","link":"https:\/\/rrt01.cn\/?p=30","title":{"rendered":"\u8bed\u6cd5\u89c4\u8303"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_68_1 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/rrt01.cn\/?p=30\/#1_%E6%A8%A1%E5%9D%97%E5%AF%BC%E5%85%A5%E8%A7%84%E8%8C%83\" title=\"1. \u6a21\u5757\u5bfc\u5165\u89c4\u8303\">1. \u6a21\u5757\u5bfc\u5165\u89c4\u8303<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/rrt01.cn\/?p=30\/#2_%E4%BD%BF%E7%94%A8%E8%A7%84%E8%8C%83%E7%9A%84%E9%A9%BC%E5%B3%B0%E5%91%BD%E5%90%8D%E6%B3%95\" title=\"2. \u4f7f\u7528\u89c4\u8303\u7684\u9a7c\u5cf0\u547d\u540d\u6cd5\">2. \u4f7f\u7528\u89c4\u8303\u7684\u9a7c\u5cf0\u547d\u540d\u6cd5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/rrt01.cn\/?p=30\/#3_%E8%AF%AD%E6%B3%95%E8%A7%84%E8%8C%83\" title=\"3. \u8bed\u6cd5\u89c4\u8303\">3. \u8bed\u6cd5\u89c4\u8303<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_%E6%A8%A1%E5%9D%97%E5%AF%BC%E5%85%A5%E8%A7%84%E8%8C%83\"><\/span>1. \u6a21\u5757\u5bfc\u5165\u89c4\u8303<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u6309\u7167 \u6807\u51c6\u5e93\u3001\u6269\u5c55\u5e93\u3001\u81ea\u5b9a\u4e49\u5e93 \u987a\u5e8f<strong>\u4f9d\u6b21\u5bfc\u5165<\/strong>, \u82e5\u5e93\u4e2d\u53ea\u4f7f\u7528\u4e86\u5c11\u91cf\u51fd\u6570, \u53ef\u4ee5\u5355\u72ec\u5bfc\u5165\u51fd\u6570\u540d\u4ee5\u52a0\u5feb\u7a0b\u5e8f\u8fd0\u884c\u901f\u5ea6<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import package          # \u5bfc\u5165\u6a21\u5757<br>import package as pack  # \u5bfc\u5165\u6a21\u5757, \u5e76\u547d\u540d\u4e3a pack<br>from package.subpackage import subsubpackage as sp<br>from package import *   # \u5bfc\u5165\u6a21\u5757\u4e2d\u6240\u6709\u51fd\u6570<br>\u200b<br># \u5bfc\u5165\u5176\u4ed6\u6587\u4ef6\u5939\u4e2d\u7684\u6a21\u5757, \u5148\u6dfb\u52a0\u73af\u5883\u53d8\u91cf<br>import os<br>os.sys.path.append(r'\u8def\u5f84')<br>import package<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_%E4%BD%BF%E7%94%A8%E8%A7%84%E8%8C%83%E7%9A%84%E9%A9%BC%E5%B3%B0%E5%91%BD%E5%90%8D%E6%B3%95\"><\/span>2. \u4f7f\u7528\u89c4\u8303\u7684\u9a7c\u5cf0\u547d\u540d\u6cd5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u9a7c\u5cf0\u547d\u540d\u4f7f\u7528\u5927\u5199\u5b57\u6bcd\u4ee5\u533a\u5206\u4e0d\u540c\u7684\u5355\u8bcd<\/p>\n\n\n\n<p><strong>(1) \u8f6c\u6362\u7c7b\u75282\u4ee3\u66ff<\/strong><\/p>\n\n\n\n<p>\u75282\u4ee3\u66ffto: str2list<\/p>\n\n\n\n<p><strong>(2) \u7f29\u5199\u7c7b\u53ea\u4fdd\u7559\u7b2c\u4e00\u4f4d\u5927\u5199<\/strong><\/p>\n\n\n\n<p>\u5982: HTML and CSS \u4f7f\u7528 HtmlAndCss, GUI element \u4f7f\u7528 GuiElement<\/p>\n\n\n\n<p><strong>(3) \u7c7b\u540d\u4f7f\u7528\u9996\u5b57\u6bcd\u5927\u5199, \u51fd\u6570\u540d\u4f7f\u7528\u9996\u5b57\u6bcd\u5c0f\u5199<\/strong><\/p>\n\n\n\n<p><strong>(4) \u9664\u4e86\u5e38\u91cf\u548c\u679a\u4e3e\u503c, \u4e0d\u8981\u4f7f\u7528\u4e0b\u5212\u7ebf<code>\u201c\\_\u201d<\/code><\/strong><\/p>\n\n\n\n<p>\u533a\u5206\u7c7b\u7684\u79c1\u6709\u5c5e\u6027\u3001\u79c1\u6709\u65b9\u6cd5<\/p>\n\n\n\n<p><strong>(5) \u5e38\u91cf\u4f7f\u7528\u5927\u5199\u5b57\u6bcd<\/strong><\/p>\n\n\n\n<p>\u5982: MAX_PARAMETER_COUNT = 100<\/p>\n\n\n\n<p><strong>(6) \u540c\u4e00\u4e2a\u53d8\u91cf\u540d\u53ea\u7528\u4e8e\u4e00\u4e2a\u7528\u9014, \u4e0d\u8981\u5faa\u73af\u8986\u76d6<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_%E8%AF%AD%E6%B3%95%E8%A7%84%E8%8C%83\"><\/span>3. \u8bed\u6cd5\u89c4\u8303<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>(1) \u8fc7\u957f\u8bed\u53e5\u4f7f\u7528\u7eed\u884c\u7b26 <code>\u2018\\\u2019<\/code><\/strong><\/p>\n\n\n\n<p><strong>(2) \u6839\u636e\u8fd0\u7b97\u7279\u70b9\u9009\u62e9\u6700\u5408\u9002\u7684\u6570\u636e\u7c7b\u578b<\/strong><\/p>\n\n\n\n<p>\u4f18\u5148\u8003\u8651\u4f7f\u7528 \u96c6\u5408\u3001\u5b57\u5178 -&gt; \u5143\u7ec4 -&gt; \u5217\u8868\u3001\u5b57\u7b26\u4e32<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9891\u7e41\u904d\u5386, \u4f7f\u7528\u5143\u7ec4\u6216\u96c6\u5408<\/li>\n\n\n\n<li>\u9891\u7e41\u6d4b\u8bd5\u67d0\u4e00\u4e2a\u5143\u7d20\u662f\u5426\u5b58\u5728\u4e00\u4e2a\u5e8f\u5217\u4e2d, \u4e14\u4e0d\u5173\u5fc3\u4f4d\u7f6e, \u4f7f\u7528\u5b57\u5178\u6216\u96c6\u5408 (in \u5bf9\u4e8e\u5217\u8868\u548c\u5143\u7ec4\u662f\u7ebf\u6027\u65f6\u95f4, \u800c\u5bf9\u4e8e\u96c6\u5408\u548c\u5b57\u5178\u662f\u5e38\u6570\u7ea7\u65f6\u95f4, \u4e0e\u89c4\u6a21\u65e0\u5173)<\/li>\n\n\n\n<li>\u6240\u6709\u6570\u636e\u7c7b\u578b\u4e2d, \u5217\u8868\u529f\u80fd\u6700\u5f3a\u5927, \u4f46\u662f\u5f00\u9500\u4e5f\u6700\u5927, \u8fd0\u884c\u901f\u5ea6\u6700\u6162<\/li>\n<\/ul>\n\n\n\n<p><strong>(3) \u5229\u7528\u903b\u8f91\u8fd0\u7b97\u7b26 and\u3001or\u3001not \u60f0\u6027\u6c42\u503c\u7279\u70b9<\/strong><\/p>\n\n\n\n<p><code>Bool1 and Bool2<\/code> \u76f8\u5f53\u4e8e<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Bool1 if not Bool1 else Bool2 <\/pre>\n\n\n\n<p>\u8fd0\u7b97\u7b26 and \u548c or \u5e76\u4e0d\u4e00\u5b9a\u4f1a\u8fd4\u56de True \u6216 False, \u800c\u662f\u5f97\u5230\u6700\u540e\u4e00\u4e2a\u8868\u8fbe\u5f0f\u7684\u503c, \u4ee5 and \u4e3a\u4f8b, \u82e5 Bool1 \u5224\u65ad\u4e3a False \u5219\u65e0\u8bba Bool2 \u662fTrue \u8fd8\u662f False, \u90fd\u4e0d\u4f1a\u5f71\u54cd\u7ed3\u679c, \u56e0\u6b64, \u7a0b\u5e8f\u4e0d\u4f1a\u8ba1\u7b97 Bool2 \u7684\u503c. \u5408\u7406\u5b89\u6392\u903b\u8f91\u987a\u5e8f\u80fd\u63d0\u9ad8\u4ee3\u7801\u8fd0\u884c\u901f\u5ea6.<\/p>\n\n\n\n<p>\u4f7f\u7528\u60f0\u6027\u8fd0\u7b97\u7279\u70b9\u5b9e\u73b0\u8fdb\u5236\u8f6c\u6362<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">def conversion(origin, originN, objectN=10):<br>    assert isinstance(origin,str) and origin.isdecimal(),'\u8f93\u5165\u7684 origin \u5fc5\u987b\u662f\u7eaf\u5b57\u7b26\u4e32\u6570\u5b57\u683c\u5f0f'<br>    assert isinstance(originN,int) and isinstance(objectN,int),'\u8f93\u5165\u7684 originN \u548c objectN \u5fc5\u987b\u662f\u5927\u4e8e1\u7684\u6574\u6570'<br>    def decimal2N(decimal, objectN):<br>        return ((decimal == 0) and \"0\") or (decimal2N(decimal \/\/ objectN, objectN).lstrip(\"0\") + \"0123456789abcdefghijklmnopqrstuvwxyz\"[decimal % objectN])<br>    return decimal2N(int(origin, originN), objectN)<br>\u200b<br>conversion('1713652', 8, objectN = 3)<br>&gt;&gt;&gt; '221021112211'<\/pre>\n\n\n\n<p><strong>4. python \u6709\u4e09\u79cd\u57fa\u672c\u50a8\u5b58\u683c\u5f0f, .py, .pyc, .pyw<\/strong><\/p>\n\n\n\n<p>.py \u662f\u6807\u51c6\u7a0b\u5e8f\u6587\u4ef6, .pyc \u662f\u7f16\u8bd1\u52a0\u5bc6\u6587\u4ef6, .pyw \u662f\u65e0\u754c\u9762\u53ef\u6267\u884c\u7a0b\u5e8f\u6587\u4ef6<\/p>\n\n\n\n<p>$$<br>\\text{.pyw}\\stackrel{\u65e0\u754c\u9762}{\\longleftarrow}\\text{.py}\\stackrel{\u7f16\u8bd1}{\\longrightarrow}\\text{.pyc}\\notag<br>$$<\/p>\n\n\n\n<p>\u5728 python \u4e2d, \u4f7f\u7528 <code>_<\/code> \u8868\u793a\u4e0a\u6b21\u4e00\u63a7\u5236\u53f0\u8f93\u51fa\u7684\u7ed3\u679c(\u76f8\u5f53\u4e8e matlab \u7684 ans)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u6a21\u5757\u5bfc\u5165\u89c4\u8303 \u6309\u7167 \u6807\u51c6\u5e93\u3001\u6269\u5c55\u5e93\u3001\u81ea\u5b9a\u4e49\u5e93 \u987a\u5e8f\u4f9d\u6b21\u5bfc\u5165, \u82e5\u5e93\u4e2d\u53ea\u4f7f\u7528\u4e86\u5c11\u91cf\u51fd\u6570, \u53ef\u4ee5\u5355\u72ec\u5bfc\u5165\u51fd\u6570&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-30","post","type-post","status-publish","format-standard","hentry","category-3"],"views":1204,"_links":{"self":[{"href":"https:\/\/rrt01.cn\/index.php?rest_route=\/wp\/v2\/posts\/30"}],"collection":[{"href":"https:\/\/rrt01.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rrt01.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rrt01.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rrt01.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=30"}],"version-history":[{"count":1,"href":"https:\/\/rrt01.cn\/index.php?rest_route=\/wp\/v2\/posts\/30\/revisions"}],"predecessor-version":[{"id":31,"href":"https:\/\/rrt01.cn\/index.php?rest_route=\/wp\/v2\/posts\/30\/revisions\/31"}],"wp:attachment":[{"href":"https:\/\/rrt01.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=30"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rrt01.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=30"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rrt01.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}