{"id":260,"date":"2023-10-27T09:48:52","date_gmt":"2023-10-27T01:48:52","guid":{"rendered":"http:\/\/ai.gitpp.com\/?p=260"},"modified":"2023-10-31T21:03:32","modified_gmt":"2023-10-31T13:03:32","slug":"%e3%80%8apython%e5%85%a5%e9%97%a8%e6%95%99%e7%a8%8b%e3%80%8b13-%e4%ba%a4%e4%ba%92%e5%bc%8f%e8%be%93%e5%85%a5%e7%bc%96%e8%be%91%e5%8f%8a%e5%8e%86%e5%8f%b2%e6%9b%bf%e4%bb%a3","status":"publish","type":"post","link":"http:\/\/ai.gitpp.com\/index.php\/2023\/10\/27\/%e3%80%8apython%e5%85%a5%e9%97%a8%e6%95%99%e7%a8%8b%e3%80%8b13-%e4%ba%a4%e4%ba%92%e5%bc%8f%e8%be%93%e5%85%a5%e7%bc%96%e8%be%91%e5%8f%8a%e5%8e%86%e5%8f%b2%e6%9b%bf%e4%bb%a3\/","title":{"rendered":"\u300aPython\u5165\u95e8\u6559\u7a0b\u300b13. \u4ea4\u4e92\u5f0f\u8f93\u5165\u7f16\u8f91\u53ca\u5386\u53f2\u66ff\u4ee3"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5f00\u80c3\u83dc<\/li>\n\n\n\n<li><a href=\"http:\/\/ai.gitpp.com\/index.php\/2023\/10\/26\/2-%e4%bd%bf%e7%94%a8-python-%e8%a7%a3%e9%87%8a%e5%99%a8\/\">\u4f7f\u7528 Python \u89e3\u91ca\u5668<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/ai.gitpp.com\/index.php\/2023\/10\/26\/3-%e9%9d%9e%e6%ad%a3%e5%bc%8f%e4%bb%8b%e7%bb%8dpython\/\">\u975e\u6b63\u5f0f\u4ecb\u7ecdPython<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/ai.gitpp.com\/index.php\/2023\/10\/26\/4-%e6%b7%b1%e5%85%a5%e6%b5%81%e7%a8%8b%e6%8e%a7%e5%88%b6\/\">\u6df1\u5165\u6d41\u7a0b\u63a7\u5236<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/ai.gitpp.com\/index.php\/2023\/10\/26\/5-%e6%95%b0%e6%8d%ae%e7%bb%93%e6%9e%84\/\">\u6570\u636e\u7ed3\u6784<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/ai.gitpp.com\/index.php\/2023\/10\/26\/6-%e6%a8%a1%e5%9d%97\/\">\u6a21\u5757<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/ai.gitpp.com\/index.php\/2023\/10\/26\/7-%e8%be%93%e5%85%a5%e5%92%8c%e8%be%93%e5%87%ba\/\">\u8f93\u5165\u548c\u8f93\u51fa<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/ai.gitpp.com\/index.php\/2023\/10\/26\/8-%e9%94%99%e8%af%af%e5%92%8c%e5%bc%82%e5%b8%b8\/\">\u9519\u8bef\u548c\u5f02\u5e38<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/ai.gitpp.com\/index.php\/2023\/10\/26\/9-%e7%b1%bb\/\">\u7c7b<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/ai.gitpp.com\/index.php\/2023\/10\/26\/10-%e6%a0%87%e5%87%86%e5%ba%93%e7%9a%84%e7%ae%80%e6%98%8e%e4%bb%8b%e7%bb%8d\/\">\u6807\u51c6\u5e93\u7684\u7b80\u660e\u4ecb\u7ecd<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/ai.gitpp.com\/index.php\/2023\/10\/26\/11-%e6%a0%87%e5%87%86%e5%ba%93%e7%9a%84%e7%ae%80%e6%98%8e%e4%bb%8b%e7%bb%8d%ef%bc%88%e7%ac%ac%e4%ba%8c%e9%83%a8%e5%88%86%ef%bc%89\/\">\u6807\u51c6\u5e93\u7684\u7b80\u660e\u4ecb\u7ecd\uff08\u7b2c\u4e8c\u90e8\u5206\uff09<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/ai.gitpp.com\/index.php\/2023\/10\/26\/12-%e7%8e%b0%e5%9c%a8%e5%b9%b2%e4%bb%80%e4%b9%88\/\">\u73b0\u5728\u5e72\u4ec0\u4e48?<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/ai.gitpp.com\/index.php\/2023\/10\/26\/13-%e4%ba%a4%e4%ba%92%e5%bc%8f%e8%be%93%e5%85%a5%e7%bc%96%e8%be%91%e5%8f%8a%e5%8e%86%e5%8f%b2%e6%9b%bf%e4%bb%a3\/\">\u4ea4\u4e92\u5f0f\u8f93\u5165\u7f16\u8f91\u53ca\u5386\u53f2\u66ff\u4ee3<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/ai.gitpp.com\/index.php\/2023\/10\/26\/14-%e6%b5%ae%e7%82%b9%e7%ae%97%e6%9c%af-%e9%97%ae%e9%a2%98%e5%92%8c%e9%99%90%e5%88%b6\/\">\u6d6e\u70b9\u7b97\u672f: \u95ee\u9898\u548c\u9650\u5236<\/a><\/li>\n<\/ol>\n\n\n\n<p>\u67d0\u4e9b\u7248\u672c\u7684 Python \u89e3\u91ca\u5668\u652f\u6301\u7f16\u8f91\u5f53\u524d\u8f93\u5165\u884c\u548c\u5386\u53f2\u66ff\u4ee3, \u5c31\u50cf Korn shell \u548c GNU Bash shell \u4e00\u6837. \u8fd9\u662f\u901a\u8fc7&nbsp;<a href=\"http:\/\/tiswww.case.edu\/php\/chet\/readline\/rltop.html\">GNU Readline<\/a>&nbsp;\u5e93\u5b9e\u73b0\u7684, \u5b83\u652f\u6301 Emacs \u6a21\u5f0f\u548c vi \u6a21\u5f0f. \u8fd9\u4e2a\u5e93\u6709\u5b83\u81ea\u5df1\u7684\u6587\u6863, \u6240\u4ee5\u5728\u8fd9\u91cc\u5c31\u4e0d\u518d\u8bf4\u4e86; \u4f46\u662f\u57fa\u7840\u7684\u4f1a\u7b80\u5355\u7684\u89e3\u91ca. \u4ea4\u4e92\u5f0f\u7684\u7f16\u8f91\u53ca\u5386\u53f2\u8bb0\u5f55\u53ef\u80fd\u4ec5\u9002\u7528\u4e8e Unix, \u53ca Cygwin \u7248\u672c\u4e0a\u7684\u89e3\u91ca\u5668.<\/p>\n\n\n\n<p>\u672c\u7ae0\u5e76*\u4e0d*\u4f1a\u8bb2 Mark Hammond \u7684 PythonWin \u5305\u6216\u8005\u662f\u4f34\u968f Python \u4e00\u8d77\u53d1\u5e03, \u57fa\u4e8e Tk \u7684IDLE. \u800c\u5728 NT \u5e73\u53f0\u4e0b\u7684\u547d\u4ee4\u884c\u7a97\u53e3\u6216\u8005\u662f DOS \u8fd9\u4e9b Windows \u6d41\u6d3e\u7684\u4e1c\u897f, \u4e5f\u4e0d\u4f1a\u63cf\u8ff0.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">13.1. \u884c\u7f16\u8f91<a href=\"https:\/\/docspy3zh.readthedocs.io\/en\/latest\/tutorial\/interactive.html#tut-lineediting\"><\/a><\/h2>\n\n\n\n<p>\u5982\u679c\u53ef\u4ee5, \u884c\u7f16\u8f91\u662f\u4e00\u76f4\u6fc0\u6d3b\u7684, \u65e0\u8bba\u662f\u5904\u4e8e\u7b2c\u4e00\u6216\u7b2c\u4e8c\u63d0\u793a\u7b26. \u5f53\u524d\u884c\u53ef\u4ee5\u4f7f\u7528\u901a\u7528\u7684 Emacs \u63a7\u5236\u7b26\u8fdb\u884c\u7f16\u8f91. \u6700\u91cd\u8981\u7684\u51e0\u4e2a:&nbsp;<code>C-A<\/code>&nbsp;(Control-A) \u79fb\u52a8\u5149\u6807\u81f3\u884c\u9996,&nbsp;<code>C-E<\/code>&nbsp;\u79fb\u52a8\u81f3\u884c\u5c3e,&nbsp;<code>C-B<\/code>&nbsp;\u5411\u5de6\u79fb\u52a8\u5149\u6807,&nbsp;<code>C-F<\/code>&nbsp;\u5411\u53f3. \u9000\u683c\u952e\u5220\u9664\u5149\u6807\u5de6\u8fb9\u7684\u4e00\u4e2a\u5b57\u7b26,&nbsp;<code>C-D<\/code>&nbsp;\u5219\u5220\u9664\u53f3\u8fb9\u7684\u5b57\u7b26.&nbsp;<code>C-K<\/code>&nbsp;\u5220\u9664\u5149\u6807\u53f3\u8fb9\u5269\u4f59\u7684\u6240\u6709\u5b57\u7b26,&nbsp;<code>C-Y<\/code>&nbsp;\u5219\u53ec\u56de\u6700\u540e\u4e00\u6b21\u88ab\u5220\u7684\u5b57\u7b26\u4e32.&nbsp;<code>C-underscore<\/code>&nbsp;\u53d6\u6d88\u6700\u540e\u4e00\u6b21\u7684\u6539\u53d8; \u8fd9\u53ef\u4ee5\u91cd\u590d\u7684\u6267\u884c.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">13.2. \u5386\u53f2\u66ff\u4ee3<a href=\"https:\/\/docspy3zh.readthedocs.io\/en\/latest\/tutorial\/interactive.html#tut-history\"><\/a><\/h2>\n\n\n\n<p>\u5386\u53f2\u66ff\u6362\u8fd0\u884c\u5982\u4e0b. \u6240\u6709\u7684\u975e\u7a7a\u8f93\u5165\u884c\u90fd\u4f1a\u88ab\u4fdd\u5b58\u4e8e\u4e00\u4e2a\u5386\u53f2\u8bb0\u5f55\u7f13\u5b58, \u5f53\u65b0\u7684\u63d0\u793a\u7b26\u7ed9\u51fa\u65f6, \u4f60\u5904\u4e8e\u8fd9\u4e2a\u7f13\u5b58\u7684\u6700\u5e95\u90e8.&nbsp;<code>C-P<\/code>&nbsp;\u53ef\u4ee5\u5411\u524d\u7ffb\u4e00\u6761\u8bb0\u5f55,&nbsp;<code>C-N<\/code>&nbsp;\u5219\u5411\u540e\u7ffb\u4e00\u6761. \u4efb\u4f55\u7684\u5386\u53f2\u8bb0\u5f55\u90fd\u662f\u53ef\u4ee5\u88ab\u7f16\u8f91\u7684; \u5982\u679c\u88ab\u4fee\u6539\u4e86, \u90a3\u4e48\u4f1a\u5728\u63d0\u793a\u7b26\u524d\u589e\u52a0\u4e00\u4e2a\u661f\u53f7. \u6309\u4e0b&nbsp;<code>Return<\/code>&nbsp;(\u4e5f\u5c31\u662f\u56de\u8f66) \u5c06\u5f53\u524d\u884c\u4f20\u9012\u7ed9\u89e3\u91ca\u5668.&nbsp;<code>C-R<\/code>&nbsp;\u8fdb\u884c\u53cd\u5411\u641c\u7d22;&nbsp;<code>C-S<\/code>&nbsp;\u5f00\u59cb\u524d\u5411\u641c\u7d22.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">13.3. \u6309\u952e\u7ed1\u5b9a<a href=\"https:\/\/docspy3zh.readthedocs.io\/en\/latest\/tutorial\/interactive.html#tut-keybindings\"><\/a><\/h2>\n\n\n\n<p>\u6309\u952e\u7684\u7ed1\u5b9a\u548c Readline \u5e93\u5176\u4ed6\u7684\u4e00\u4e9b\u53c2\u6570\u53ef\u4ee5\u5728\u00a0<code>~\/.inputrc<\/code>\u00a0\u4e2d\u6307\u660e. \u6309\u952e\u7ed1\u5b9a\u7684\u5f62\u5f0f:<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">key-name: function-name<\/p>\n\n\n\n<p>\u6216:<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">\u201dstring\u201d: function-name<\/p>\n\n\n\n<p>\u9009\u9879\u53ef\u4ee5\u8fd9\u6837\u8bbe\u7f6e:<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">set option-name value<\/p>\n\n\n\n<p>\u4e3e\u4e2a\u4f8b\u5b50:<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><em># I prefer vi-style editing:<\/em>\u00a0<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">set editing-mode vi<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">\u00a0<em># Edit using a single line:<\/em>\u00a0<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">set horizontal-scroll-mode On<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">\u00a0<em># Rebind some keys:<\/em>\u00a0<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">Meta-h: backward-kill-word <\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">\u201c\\C-u\u201d: universal-argument<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"> \u201c\\C-x\\C-r\u201d: re-read-init-file<\/p>\n\n\n\n<p>\u6ce8\u610f, \u9ed8\u8ba4\u60c5\u51b5\u4e0b\u00a0<code>Tab<\/code>\u00a0\u5728 Python \u4e2d\u662f\u7528\u4e8e\u63d2\u5165\u4e00\u4e2a\u00a0<code>Tab<\/code>\u00a0\u5b57\u7b26, \u800c\u975e Readline \u9ed8\u8ba4\u7684\u6587\u4ef6\u540d\u8865\u5168\u51fd\u6570. \u5982\u679c\u4f60\u8981\u7528, \u53ef\u4ee5\u5199\u5165\u4e0b\u9762\u8fd9\u884c\u7528\u4e8e\u6539\u5199\u8fd9\u4e2a\u884c\u4e3a:<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">Tab: complete<\/p>\n\n\n\n<p>\u5728\u4f60\u7684&nbsp;<code>~\/.inputrc<\/code>&nbsp;\u4e2d. (\u5f53\u7136, \u8fd9\u6837\u5728\u7f29\u8fdb\u65f6\u5c31\u4f1a\u6709\u4e9b\u9ebb\u70e6.)<\/p>\n\n\n\n<p id=\"index-0\">\u81ea\u52a8\u8865\u5168\u53d8\u91cf\u4e0e\u6a21\u5757\u540d\u4e5f\u662f\u53ef\u9009\u7684. \u4e3a\u4e86\u5f00\u542f\u8fd9\u4e2a\u6a21\u5f0f, \u5c06\u4e0b\u9762\u8fd9\u6bb5\u589e\u52a0\u5230\u4f60\u7684\u542f\u52a8\u6587\u4ef6\u4e2d:\u00a0<a href=\"https:\/\/docspy3zh.readthedocs.io\/en\/latest\/tutorial\/interactive.html#id13\">[1]<\/a><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\" id=\"index-0\"><strong>importrlcompleter<\/strong>,\u00a0<strong>readline<\/strong><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\" id=\"index-0\">\u00a0readline.parse_and_bind(\u2018tab: complete\u2019)<\/p>\n\n\n\n<p>\u8fd9\u5c31\u5c06&nbsp;<code>Tab<\/code>&nbsp;\u952e\u7ed1\u5b9a\u4e86\u8865\u5168\u7684\u529f\u80fd, \u6240\u4ee5\u6309\u4e24\u6b21&nbsp;<code>Tab<\/code>&nbsp;\u952e\u5c31\u4f1a\u7ed9\u4f60\u63d0\u793a; \u5b83\u4f1a\u641c\u5bfb Python \u4e2d\u8bed\u53e5\u7684\u540d\u5b57, \u5f53\u524d\u7684\u5c40\u90e8\u53d8\u91cf, \u548c\u53ef\u7528\u7684\u6a21\u5757\u540d. \u5bf9\u4e8e\u70b9\u53f7\u7684\u8868\u8fbe\u5f0f\u5982&nbsp;<code>string.a<\/code>, \u5219\u4f1a\u6267\u884c\u5230\u6700\u540e\u7684\u70b9\u53f7\u4f4d\u7f6e\u7684\u8bed\u53e5, \u7136\u540e\u7ed9\u51fa\u8fd9\u4e2a\u5bf9\u8c61\u7684\u5c5e\u6027. \u6ce8\u610f, \u8fd9\u4f1a\u6267\u884c\u7a0b\u5e8f\u4e2d\u5b9a\u4e49\u7684\u4ee3\u7801, \u5982\u679c\u4e00\u4e2a\u6709&nbsp;<a href=\"https:\/\/docspy3zh.readthedocs.io\/en\/latest\/reference\/datamodel.html#object.__getattr__\"><code>__getattr__()<\/code><\/a>&nbsp;\u65b9\u6cd5\u7684\u5bf9\u8c61\u662f\u8868\u8fbe\u5f0f\u7684\u4e00\u90e8\u5206.<\/p>\n\n\n\n<p>\u4e00\u4e2a\u66f4\u806a\u660e\u7684\u542f\u52a8\u6587\u4ef6\u53ef\u4ee5\u662f\u8fd9\u6837\u5b50\u7684. \u6ce8\u610f\u8fd9\u4e2a\u4f1a\u5220\u9664\u5b83\u521b\u5efa\u7684\u4f46\u662f\u4e0d\u9700\u8981\u518d\u7528\u7684\u540d\u5b57; \u4ece\u542f\u52a8\u6587\u4ef6\u5728\u540c\u4e00\u547d\u540d\u7a7a\u95f4\u6267\u884c\u540e, \u5b83\u5c31\u5f00\u59cb\u8fd0\u884c, \u7136\u540e\u79fb\u9664\u8fd9\u4e9b\u540d\u5b57\u4ee5\u907f\u514d\u5bf9\u540e\u9762\u7684\u4ea4\u4e92\u73af\u5883\u4ea7\u751f\u526f\u4f5c\u7528. \u4f60\u4f1a\u53d1\u73b0\u5b83\u5bf9\u4e8e\u7528\u4e8e\u4fdd\u7559\u67d0\u4e9b\u5bfc\u5165\u7684\u6a21\u5757\u975e\u5e38\u6709\u7528, \u6bd4\u5982\u00a0<a href=\"https:\/\/docspy3zh.readthedocs.io\/en\/latest\/library\/os.html#module-os\"><code>os<\/code><\/a>, \u8fd9\u5728\u591a\u6570\u4f1a\u8bdd\u4e2d\u90fd\u4f1a\u88ab\u5927\u91cf\u4f7f\u7528.<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><em># Add auto-completion and a stored history file of commands to your Python<\/em><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><em># interactive interpreter. Requires Python 2.0+, readline. Autocomplete is<\/em><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><em># bound to the Esc key by default (you can change it \u2013 see readline docs).<\/em><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><em>#<\/em><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><em># Store the file in ~\/.pystartup, and set an environment variable to point<\/em><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><em># to it: \u201cexport PYTHONSTARTUP=\/home\/user\/.pystartup\u201d in bash.<\/em><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><em>#<\/em><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><em># Note that PYTHONSTARTUP does *not* expand \u201c~\u201d, so you have to put in the<\/em><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><em># full path to your home directory.<\/em><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><strong>import atexit<\/strong><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><strong>import os<\/strong><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><strong>import readline<\/strong><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><strong>importrlcompleter<\/strong>\u00a0historyPath = os.path.expanduser(\u201c~\/.pyhistory\u201d)\u00a0<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><strong>def<\/strong>\u00a0save_history(historyPath=historyPath):<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">\u00a0<strong>import readline<\/strong>\u00a0<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">readline.write_history_file(historyPath)\u00a0<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><strong>if<\/strong>\u00a0os.path.exists(historyPath):<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"> readline.read_history_file(historyPath)<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"> atexit.register(save_history)\u00a0<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><strong>del<\/strong>\u00a0os, atexit, readline, rlcompleter, save_history, historyPath<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">13.4. \u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u7684\u66ff\u4ee3\u54c1<a href=\"https:\/\/docspy3zh.readthedocs.io\/en\/latest\/tutorial\/interactive.html#tut-commentary\"><\/a><\/h2>\n\n\n\n<p>\u76f8\u5bf9\u4e8e\u65e9\u671f\u7684\u89e3\u6790\u5668\u6765\u8bf4, \u8fd9\u662f\u4e00\u4e2a\u5f88\u5927\u7684\u8fdb\u6b65; \u4f46\u662f, \u6709\u4e9b\u613f\u671b\u4ecd\u672a\u5b9e\u73b0: \u5982\u679c\u5728\u7eed\u884c\u65f6\u6709\u5408\u9002\u7684\u7f29\u8fdb\u90a3\u4e48\u4f1a\u5f88\u68d2 (\u89e3\u6790\u5668\u4f1a\u77e5\u9053\u4e0b\u9762\u7684\u7f29\u8fdb\u662f\u5426\u9700\u8981). \u81ea\u52a8\u8865\u5168\u7684\u673a\u5236\u53ef\u80fd\u4f7f\u7528\u89e3\u91ca\u5668\u7684\u7b26\u53f7\u8868. \u7528\u4e8e\u68c0\u67e5\u6216\u5efa\u8bae\u5339\u914d\u62ec\u53f7, \u5f15\u53f7\u7b49\u7684\u5de5\u5177\u4e5f\u4f1a\u975e\u5e38\u6709\u7528.<\/p>\n\n\n\n<p>\u4e00\u4e2a\u53ef\u9009\u7684\u589e\u5f3a\u578b\u89e3\u91ca\u5668\u5e94\u8be5\u7b97&nbsp;<a href=\"http:\/\/ipython.scipy.org\/\">IPython<\/a>&nbsp;\u4e86, \u5b83\u6709 tab \u8865\u5168, \u5bf9\u8c61\u63a2\u7d22, \u548c\u66f4\u9ad8\u7ea7\u7684\u5386\u53f2\u7ba1\u7406\u529f\u80fd. \u5b83\u4e5f\u53ef\u4ee5\u88ab\u5b9a\u5236, \u5d4c\u5165\u5176\u4ed6\u7684\u5e94\u7528. \u53e6\u5916\u4e00\u4e2a\u5219\u662f&nbsp;<a href=\"http:\/\/www.bpython-interpreter.org\/\">bpython<\/a>.<\/p>\n\n\n\n<p>Footnotes<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><a href=\"https:\/\/docspy3zh.readthedocs.io\/en\/latest\/tutorial\/interactive.html#id11\">[1]<\/a><\/td><td>\u5728\u4f60\u6253\u5f00\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u7684\u65f6\u5019, Python \u4f1a\u6267\u884c\u4e00\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9, \u8fd9\u4e2a\u6587\u4ef6\u7531\u73af\u5883\u53d8\u91cf&nbsp;<a href=\"https:\/\/docspy3zh.readthedocs.io\/en\/latest\/using\/cmdline.html#envvar-PYTHONSTARTUP\"><code>PYTHONSTARTUP<\/code><\/a>&nbsp;\u6307\u5b9a.<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u67d0\u4e9b\u7248\u672c\u7684 Python \u89e3\u91ca\u5668\u652f\u6301\u7f16\u8f91\u5f53\u524d\u8f93\u5165\u884c\u548c\u5386\u53f2\u66ff\u4ee3, \u5c31\u50cf Korn shell \u548c GNU Bas [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-260","post","type-post","status-publish","format-standard","hentry","category-python"],"blocksy_meta":"","_links":{"self":[{"href":"http:\/\/ai.gitpp.com\/index.php\/wp-json\/wp\/v2\/posts\/260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/ai.gitpp.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ai.gitpp.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ai.gitpp.com\/index.php\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"http:\/\/ai.gitpp.com\/index.php\/wp-json\/wp\/v2\/comments?post=260"}],"version-history":[{"count":3,"href":"http:\/\/ai.gitpp.com\/index.php\/wp-json\/wp\/v2\/posts\/260\/revisions"}],"predecessor-version":[{"id":427,"href":"http:\/\/ai.gitpp.com\/index.php\/wp-json\/wp\/v2\/posts\/260\/revisions\/427"}],"wp:attachment":[{"href":"http:\/\/ai.gitpp.com\/index.php\/wp-json\/wp\/v2\/media?parent=260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ai.gitpp.com\/index.php\/wp-json\/wp\/v2\/categories?post=260"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ai.gitpp.com\/index.php\/wp-json\/wp\/v2\/tags?post=260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}