{"id":167992,"date":"2022-04-21T12:24:03","date_gmt":"2022-04-21T04:24:03","guid":{"rendered":"http:\/\/www.idc.net\/help\/167992\/"},"modified":"2022-04-21T12:24:03","modified_gmt":"2022-04-21T04:24:03","slug":"%e5%90%8e%e6%b5%aa%e4%ba%91python%e6%95%99%e7%a8%8b%ef%bc%9a14-%e4%ba%a4%e4%ba%92%e5%bc%8f%e7%bc%96%e8%be%91%e5%92%8c%e7%bc%96%e8%be%91%e5%8e%86%e5%8f%b2","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/167992\/","title":{"rendered":"\u540e\u6d6a\u4e91Python\u6559\u7a0b\uff1a14. \u4ea4\u4e92\u5f0f\u7f16\u8f91\u548c\u7f16\u8f91\u5386\u53f2"},"content":{"rendered":"<h1>14. \u4ea4\u4e92\u5f0f\u7f16\u8f91\u548c\u7f16\u8f91\u5386\u53f2<\/h1>\n<p>\u67d0\u4e9b\u7248\u672c\u7684 Python \u89e3\u91ca\u5668\u652f\u6301\u7f16\u8f91\u5f53\u524d\u8f93\u5165\u884c\u548c\u7f16\u8f91\u5386\u53f2\u8bb0\u5f55\uff0c\u7c7b\u4f3c Korn shell \u548c GNU Bash shell \u7684\u529f\u80fd \u3002\u8fd9\u4e2a\u529f\u80fd\u4f7f\u7528\u4e86 GNU Readline \u6765\u5b9e\u73b0\uff0c\u4e00\u4e2a\u652f\u6301\u591a\u79cd\u7f16\u8f91\u65b9\u5f0f\u7684\u5e93\u3002\u8fd9\u4e2a\u5e93\u6709\u5b83\u81ea\u5df1\u7684\u6587\u6863\uff0c\u5728\u8fd9\u91cc\u6211\u4eec\u5c31\u4e0d\u91cd\u590d\u8bf4\u660e\u4e86\u3002<\/p>\n<h2>14.1. Tab \u8865\u5168\u548c\u7f16\u8f91\u5386\u53f2<\/h2>\n<p>\u5728\u89e3\u91ca\u5668\u542f\u52a8\u7684\u65f6\u5019\uff0c\u8865\u5168\u53d8\u91cf\u548c\u6a21\u5757\u540d\u7684\u529f\u80fd\u5c06 \u81ea\u52a8\u6253\u5f00\uff0c\u4ee5\u4fbf\u5728\u6309\u4e0b Tab \u952e\u7684\u65f6\u5019\u8c03\u7528\u8865\u5168\u51fd\u6570\u3002\u5b83\u4f1a\u67e5\u770b Python \u8bed\u53e5\u540d\u79f0\uff0c\u5f53\u524d\u5c40\u90e8\u53d8\u91cf\u548c\u53ef\u7528\u7684\u6a21\u5757\u540d\u79f0\u3002\u5904\u7406\u50cf <code>string.a<\/code> \u7684\u8868\u8fbe\u5f0f\uff0c\u5b83\u4f1a\u6c42\u503c\u5728\u6700\u540e\u4e00\u4e2a <code>'.'<\/code> \u4e4b\u524d\u7684\u8868\u8fbe\u5f0f\uff0c\u63a5\u7740\u6839\u636e\u6c42\u503c\u7ed3\u679c\u5bf9\u8c61\u7684\u5c5e\u6027\u7ed9\u51fa\u8865\u5168\u5efa\u8bae\u3002\u5982\u679c\u62e5\u6709 <code>__getattr__()<\/code> \u65b9\u6cd5\u7684\u5bf9\u8c61\u662f\u8868\u8fbe\u5f0f\u7684\u4e00\u90e8\u5206\uff0c\u6ce8\u610f\u8fd9\u53ef\u80fd\u4f1a\u6267\u884c\u7a0b\u5e8f\u5b9a\u4e49\u7684\u4ee3\u7801\u3002\u9ed8\u8ba4\u914d\u7f6e\u4e0b\u4f1a\u628a\u7f16\u8f91\u5386\u53f2\u8bb0\u5f55\u4fdd\u5b58\u5728\u7528\u6237\u76ee\u5f55\u4e0b\u540d\u4e3a <code>.python_history<\/code> \u7684\u6587\u4ef6\u3002\u5728\u4e0b\u4e00\u6b21 Python \u89e3\u91ca\u5668\u4f1a\u8bdd\u671f\u95f4\uff0c\u7f16\u8f91\u5386\u53f2\u8bb0\u5f55\u4ecd\u65e7\u53ef\u7528\u3002<\/p>\n<h2>14.2. \u9ed8\u8ba4\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u7684\u66ff\u4ee3\u54c1<\/h2>\n<p>Python \u89e3\u91ca\u5668\u4e0e\u65e9\u671f\u7248\u672c\u7684\u76f8\u6bd4\uff0c\u5411\u524d\u8fc8\u8fdb\u4e86\u4e00\u5927\u6b65\uff1b\u65e0\u8bba\u600e\u6837\uff0c\u8fd8\u6709\u4e9b\u5e0c\u671b\u7684\u529f\u80fd\uff1a\u5982\u679c\u80fd\u5728\u7f16\u8f91\u8fde\u7eed\u884c\u65f6\u5efa\u8bae\u7f29\u8fdb\uff08\u89e3\u6790\u5668\u77e5\u9053\u63a5\u4e0b\u6765\u662f\u5426\u9700\u8981\u7f29\u8fdb\u7b26\u53f7\uff09\uff0c\u90a3\u5c06\u5f88\u68d2\u3002\u8865\u5168\u673a\u5236\u53ef\u4ee5\u4f7f\u7528\u89e3\u91ca\u5668\u7684\u7b26\u53f7\u8868\u3002\u6709\u547d\u4ee4\u53bb\u68c0\u67e5\uff08\u751a\u81f3\u5efa\u8bae\uff09\u62ec\u53f7\uff0c\u5f15\u53f7\u4ee5\u53ca\u5176\u4ed6\u7b26\u53f7\u662f\u5426\u5339\u914d\u3002<\/p>\n<p>\u4e00\u4e2a\u53ef\u9009\u7684\u589e\u5f3a\u578b\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u662f IPython\uff0c\u5b83\u5df2\u7ecf\u5b58\u5728\u4e86\u6709\u4e00\u6bb5\u65f6\u95f4\uff0c\u5b83\u5177\u6709 tab \u8865\u5168\uff0c\u63a2\u7d22\u5bf9\u8c61\u548c\u9ad8\u7ea7\u5386\u53f2\u8bb0\u5f55\u7ba1\u7406\u529f\u80fd\u3002\u5b83\u8fd8\u53ef\u4ee5\u5f7b\u5e95\u5b9a\u5236\u5e76\u5d4c\u5165\u5230\u5176\u4ed6\u5e94\u7528\u7a0b\u5e8f\u4e2d\u3002\u53e6\u4e00\u4e2a\u76f8\u4f3c\u7684\u589e\u5f3a\u578b\u4ea4\u4e92\u5f0f\u73af\u5883\u662f bpython\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>14. \u4ea4\u4e92\u5f0f\u7f16\u8f91\u548c\u7f16\u8f91\u5386\u53f2 \u67d0\u4e9b\u7248\u672c\u7684 Python \u89e3\u91ca\u5668\u652f\u6301\u7f16\u8f91\u5f53\u524d\u8f93\u5165\u884c\u548c\u7f16\u8f91\u5386\u53f2\u8bb0\u5f55\uff0c\u7c7b\u4f3c Korn [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[182397],"tags":[],"class_list":["post-167992","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/167992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=167992"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/167992\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=167992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=167992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=167992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}