{"id":70480,"date":"2024-01-16T21:19:37","date_gmt":"2024-01-16T13:19:37","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=70480"},"modified":"2024-01-16T21:19:37","modified_gmt":"2024-01-16T13:19:37","slug":"interface-python-library","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/interface-python-library.html","title":{"rendered":"\u5982\u4f55\u6784\u5efa\u4f18\u79c0\u7684\u547d\u4ee4\u884c\u7528\u6237\u754c\u9762\u7684 Python \u5e93"},"content":{"rendered":"
\u5728\u8fd9\u4e2a\u5206\u4e3a\u4e24\u7bc7\u7684\u5173\u4e8e\u5177\u6709\u7edd\u4f73\u547d\u4ee4\u884c\u754c\u9762\u7684\u7ec8\u7aef\u7a0b\u5e8f\u7684\u7cfb\u5217\u6587\u7ae0\u7684\u7b2c\u4e8c\u7bc7\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u8ba8\u8bba Prompt\u3001Toolkit\u3001Click\u3001Pygments \u548c Fuzzy Finder \u3002
\n<\/p>\n
\u8fd9\u662f\u6211\u7684\u4e00\u4e2a\u5206\u4e3a\u4e24\u7bc7\u7684\u5173\u4e8e\u5177\u6709\u7edd\u4f73\u547d\u4ee4\u884c\u754c\u9762\u7684\u7ec8\u7aef\u7a0b\u5e8f\u7684\u7cfb\u5217\u6587\u7ae0\u7684\u7b2c\u4e8c\u7bc7\u6559\u7a0b\u3002\u5728\u7b2c\u4e00\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u8ba8\u8bba\u4e86\u4e00\u4e9b\u80fd\u591f\u4f7f\u547d\u4ee4\u884c\u5e94\u7528\u7528\u8d77\u6765\u4ee4\u4eba\u611f\u5230\u6109\u60a6\u7684\u7279\u6027\u3002\u5728\u7b2c\u4e8c\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u6765\u770b\u770b\u5982\u4f55\u7528 Python \u7684\u4e00\u4e9b\u5e93\u6765\u5b9e\u73b0\u8fd9\u4e9b\u7279\u6027\u3002<\/p>\n
\u6211\u6253\u7b97\u7528\u5c11\u4e8e 20 \u884c Python \u4ee3\u7801\u6765\u5b9e\u73b0\u3002\u8ba9\u6211\u4eec\u5f00\u59cb\u5427\u3002<\/p>\n
\u6211\u4e60\u60ef\u4e8e\u628a\u8fd9\u4e2a\u5e93\u79f0\u4e3a\u547d\u4ee4\u884c\u5e94\u7528\u7684\u745e\u58eb\u519b\u5200\uff0c\u5b83\u53ef\u4ee5\u4f5c\u4e3areadline\u3001curses\u7b49\u7684\u66ff\u4ee3\u54c1\u3002\u8ba9\u6211\u4eec\u9996\u5148\u5b89\u88c5\u8fd9\u4e2a\u5e93\uff0c\u7136\u540e\u5f00\u59cb\u8be5\u6559\u7a0b\uff1a<\/p>\n
pip install prompt_toolkit\r\n<\/pre>\n\u6211\u4eec\u4ee5\u4e00\u4e2a\u7b80\u5355\u7684 REPL \uff08LCTT \u8bd1\u6ce8\uff1aREPL \u2014\u2014 Read-Eval-Print Loop\uff0c\u4ea4\u4e92\u5f0f\u5f00\u53d1\u73af\u5883\uff09\u5f00\u59cb\u3002\u4e00\u4e2a\u5178\u578b\u7684 REPL \u4f1a\u63a5\u6536\u7528\u6237\u7684\u8f93\u5165\uff0c\u8fdb\u884c\u4e00\u4e2a\u64cd\u4f5c\uff0c\u7136\u540e\u8f93\u51fa\u7ed3\u679c\u3002\u6bd4\u5982\u5728\u6211\u4eec\u7684\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u5c06\u8981\u5b9e\u73b0\u4e00\u4e2a\u5177\u6709 \u201c\u56de\u663e\u201d \u529f\u80fd\u7684 REPL \u3002\u5b83\u4ec5\u4ec5\u662f\u539f\u6837\u6253\u5370\u51fa\u7528\u6237\u7684\u8f93\u5165\uff1a<\/p>\n
REPL<\/strong><\/span><\/div>\nfrom prompt_toolkit import prompt\r\n\r\nwhile 1:\r\n user_input = prompt('>')\r\n print(user_input)\r\n<\/pre>\n\u8fd9\u5c31\u662f\u5b9e\u73b0 REPL \u7684\u5168\u90e8\u4ee3\u7801\u3002\u5b83\u53ef\u4ee5\u8bfb\u53d6\u7528\u6237\u7684\u8f93\u5165\uff0c\u7136\u540e\u6253\u5370\u51fa\u7528\u6237\u7684\u8f93\u5165\u5185\u5bb9\u3002\u5728\u8fd9\u6bb5\u4ee3\u7801\u4e2d\u4f7f\u7528\u7684prompt\u51fd\u6570\u6765\u81ea prompt_toolkit\u5e93\uff0c\u5b83\u662freadline\u5e93\u7684\u4e00\u4e2a\u66ff\u4ee3\u54c1\u3002<\/p>\n
\u547d\u4ee4\u5386\u53f2<\/strong><\/span><\/div>\n\u4e3a\u4e86\u589e\u5f3a\u6211\u4eec\u7684 REPL \u7684\u529f\u80fd\uff0c\u6211\u4eec\u53ef\u4ee5\u6dfb\u52a0\u547d\u4ee4\u5386\u53f2\uff1a<\/p>\n
from prompt_toolkit import prompt\r\nfrom prompt_toolkit.history import FileHistory\r\n\r\nwhile 1:\r\n user_input = prompt('>', \r\n history=FileHistory('history.txt'),\r\n )\r\n print(user_input)\r\n<\/pre>\n\u6211\u4eec\u521a\u521a\u7ed9 REPL \u6dfb\u52a0\u4e86\u6301\u4e45\u7684\u547d\u4ee4\u5386\u53f2\u3002\u73b0\u5728\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e0a\/\u4e0b\u7bad\u5934\u6765\u6d4f\u89c8\u547d\u4ee4\u5386\u53f2\uff0c\u5e76\u4f7f\u7528Ctrl-R\u6765\u641c\u7d22\u547d\u4ee4\u5386\u53f2\u3002\u5b83\u6ee1\u8db3\u4e86\u547d\u4ee4\u884c\u7684\u57fa\u672c\u51c6\u5219\u3002<\/p>\n
\u81ea\u52a8\u63a8\u8350<\/strong><\/span><\/div>\n\u5728\u7b2c\u4e00\u7bc7\u6559\u7a0b\u4e2d\uff0c\u6211\u8bb2\u5230\u7684\u4e00\u4e2a\u53ef\u53d1\u73b0\u6027\u6280\u5de7\u662f\u81ea\u52a8\u63a8\u8350\u5386\u53f2\u547d\u4ee4\u3002\uff08\u6211\u662f\u9996\u5148\u5728 fish shell<\/strong> \u4e2d\u770b\u5230\u7684\u8fd9\u4e00\u7279\u6027\uff09\u8ba9\u6211\u4eec\u628a\u8fd9\u4e00\u7279\u6027\u52a0\u5165\u5230\u6211\u4eec\u7684 REPL \u4e2d\uff1a<\/p>\n
from prompt_toolkit import prompt\r\nfrom prompt_toolkit.history import FileHistory\r\nfrom prompt_toolkit.auto_suggest import AutoSuggestFromHistory\r\n\r\nwhile 1:\r\n user_input = prompt('>', \r\n history=FileHistory('history.txt'),\r\n auto_suggest=AutoSuggestFromHistory(),\r\n )\r\n print(user_input)\r\n<\/pre>\n\u6211\u4eec\u53ea\u9700\u8981\u7ed9prompt() API \u8c03\u7528\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u53c2\u6570\u3002\u73b0\u5728\uff0c\u6211\u4eec\u6709\u4e86\u4e00\u4e2a\u5177\u6709fish shell\u98ce\u683c\u7684 REPL\uff0c\u5b83\u53ef\u4ee5\u81ea\u52a8\u63a8\u8350\u5386\u53f2\u547d\u4ee4\u3002<\/p>\n
\u81ea\u52a8\u8865\u5168<\/strong><\/span><\/div>\n\u73b0\u5728\uff0c\u8ba9\u6211\u4eec\u901a\u8fc7\u81ea\u52a8\u8865\u5168<\/strong>\u6765\u52a0\u5f3a Tab \u8865\u5168\u3002\u5b83\u80fd\u591f\u5728\u7528\u6237\u5f00\u59cb\u8f93\u5165\u7684\u65f6\u5019\u5f39\u51fa\u53ef\u80fd\u7684\u547d\u4ee4\u63a8\u8350\u3002<\/p>\n
REPL \u5982\u4f55\u6765\u8fdb\u884c\u63a8\u8350\u5462\uff1f\u6211\u4eec\u4f7f\u7528\u4e00\u4e2a\u5b57\u5178\u6765\u8fdb\u884c\u53ef\u80fd\u9879\u7684\u63a8\u8350\u3002<\/p>\n
\u6bd4\u5982\u8bf4\u6211\u4eec\u5b9e\u73b0\u4e00\u4e2a\u9488\u5bf9 SQL \u7684 REPL \u3002\u6211\u4eec\u53ef\u4ee5\u628a SQL \u5173\u952e\u5b57\u5b58\u5230\u81ea\u52a8\u8865\u5168\u5b57\u5178\u91cc\u9762\u3002\u8ba9\u6211\u4eec\u770b\u4e00\u770b\u8fd9\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1a<\/p>\n
from prompt_toolkit import prompt\r\nfrom prompt_toolkit.history import FileHistory\r\nfrom prompt_toolkit.auto_suggest import AutoSuggestFromHistory\r\nfrom prompt_toolkit.contrib.completers import WordCompleter\r\n\r\nSQLCompleter = WordCompleter(['select', 'from', 'insert', 'update', 'delete', 'drop'],\r\n ignore_case=True)\r\n\r\nwhile 1:\r\n user_input = prompt('SQL>', \r\n history=FileHistory('history.txt'),\r\n auto_suggest=AutoSuggestFromHistory(),\r\n completer=SQLCompleter,\r\n )\r\n print(user_input)\r\n<\/pre>\n\u518d\u6b21\u8bf4\u660e\uff0c\u6211\u4eec\u53ea\u662f\u7b80\u5355\u7684\u4f7f\u7528\u4e86 prompt-toolkit<\/span> \u5185\u5efa\u7684\u4e00\u4e2a\u53eb\u505a WordCompleter<\/span> \u7684\u8865\u5168\u7279\u6027\uff0c\u5b83\u80fd\u591f\u628a\u7528\u6237\u8f93\u5165\u548c\u53ef\u80fd\u63a8\u8350\u7684\u5b57\u5178\u8fdb\u884c\u5339\u914d\uff0c\u7136\u540e\u63d0\u4f9b\u4e00\u4e2a\u5217\u8868\u3002<\/p>\n
\u73b0\u5728\uff0c\u6211\u4eec\u6709\u4e86\u4e00\u4e2a\u80fd\u591f\u81ea\u52a8\u8865\u5168\u3001fish shell \u98ce\u683c\u7684\u5386\u53f2\u547d\u4ee4\u63a8\u8350\u4ee5\u53ca\u4e0a\/\u4e0b\u6d4f\u89c8\u5386\u53f2\u7684 REPL \u3002\u5b9e\u73b0\u8fd9\u4e9b\u7279\u6027\u53ea\u7528\u4e86\u4e0d\u5230 10 \u884c\u7684\u5b9e\u9645\u4ee3\u7801\u3002<\/p>\n
Click<\/strong><\/div>\nClick\u662f\u4e00\u4e2a\u547d\u4ee4\u884c\u521b\u5efa\u5de5\u5177\u5305\uff0c\u4f7f\u7528\u5b83\u80fd\u591f\u66f4\u5bb9\u6613\u7684\u4e3a\u7a0b\u5e8f\u89e3\u6790\u547d\u4ee4\u884c\u9009\u9879\u7684\u53c2\u6570\u548c\u5e38\u91cf\u3002\u5728\u8fd9\u513f\u6211\u4eec\u4e0d\u8ba8\u8bba\u5982\u4f55\u4f7f\u7528Click\u6765\u4f5c\u4e3a\u53c2\u6570\u89e3\u6790\u5668\u3002\u76f8\u53cd\uff0c\u6211\u4eec\u5c06\u4f1a\u770b\u770bClick\u5e26\u6709\u7684\u4e00\u4e9b\u529f\u80fd\u3002<\/p>\n
\u5b89\u88c5Click\uff1a<\/p>\n
pip install click\r\n<\/pre>\n\u5206\u9875\u5668\u662f Unix \u7cfb\u7edf\u4e0a\u7684\u5b9e\u7528\u5de5\u5177\uff0c\u5b83\u4eec\u80fd\u591f\u4e00\u6b21\u4e00\u9875\u5730\u663e\u793a\u5f88\u957f\u7684\u8f93\u51fa\u3002\u5206\u9875\u5668\u7684\u4e00\u4e9b\u4f8b\u5b50\u5305\u62ecless\u3001more\u3001most\u7b49\u3002\u901a\u8fc7\u5206\u9875\u5668\u6765\u663e\u793a\u4e00\u4e2a\u547d\u4ee4\u7684\u8f93\u51fa\u4e0d\u4ec5\u4ec5\u662f\u4e00\u4e2a\u53cb\u597d\u7684\u8bbe\u8ba1\uff0c\u540c\u65f6\u4e5f\u662f\u5fc5\u8981\u7684\u3002<\/p>\n
\u8ba9\u6211\u4eec\u8fdb\u4e00\u6b65\u6539\u8fdb\u524d\u9762\u7684\u4f8b\u5b50\u3002\u6211\u4eec\u4e0d\u518d\u4f7f\u7528\u9ed8\u8ba4print()\u8bed\u53e5\uff0c\u53d6\u800c\u4ee3\u4e4b\u7684\u662fclick.echo_via_pager()\u3002\u5b83\u5c06\u4f1a\u628a\u8f93\u51fa\u901a\u8fc7\u5206\u9875\u5668\u53d1\u9001\u5230\u6807\u51c6\u8f93\u51fa\u3002\u8fd9\u662f\u5e73\u53f0\u65e0\u5173\u7684\uff0c\u56e0\u6b64\u5728 Unix \u7cfb\u7edf\u6216 Windows \u7cfb\u7edf\u4e0a\u5747\u80fd\u5de5\u4f5c\u3002\u5982\u679c\u5fc5\u8981\u7684\u8bdd\uff0cclick_via_pager \u4f1a\u5c1d\u8bd5\u4f7f\u7528\u4e00\u4e2a\u5408\u9002\u7684\u9ed8\u8ba4\u5206\u9875\u5668\u6765\u8f93\u51fa\uff0c\u4ece\u800c\u80fd\u591f\u663e\u793a\u4ee3\u7801\u9ad8\u4eae\u3002<\/p>\n
from prompt_toolkit import prompt\r\nfrom prompt_toolkit.history import FileHistory\r\nfrom prompt_toolkit.auto_suggest import AutoSuggestFromHistory\r\nfrom prompt_toolkit.contrib.completers import WordCompleter\r\nimport click\r\n\r\nSQLCompleter = WordCompleter(['select', 'from', 'insert', 'update', 'delete', 'drop'],\r\n ignore_case=True)\r\n\r\nwhile 1:\r\n user_input = prompt(u'SQL>',\r\n history=FileHistory('history.txt'),\r\n auto_suggest=AutoSuggestFromHistory(),\r\n completer=SQLCompleter,\r\n )\r\n click.echo_via_pager(user_input)\r\n<\/pre>\n\u7f16\u8f91\u5668<\/strong><\/span><\/div>\n\u5728\u6211\u524d\u9762\u7684\u6587\u7ae0\u4e2d\u4e00\u4e2a\u503c\u5f97\u4e00\u63d0\u7684\u7ec6\u8282\u662f\uff0c\u5f53\u547d\u4ee4\u8fc7\u4e8e\u590d\u6742\u7684\u65f6\u5019\u8fdb\u5165\u7f16\u8f91\u5668\u6765\u7f16\u8f91\u3002Click<\/span> \u6709\u4e00\u4e2a\u7b80\u5355\u7684 API<\/a> \u80fd\u591f\u6253\u5f00\u7f16\u8f91\u5668\uff0c\u7136\u540e\u628a\u5728\u7f16\u8f91\u5668\u4e2d\u8f93\u5165\u7684\u6587\u672c\u8fd4\u56de\u7ed9\u5e94\u7528\u3002<\/p>\n
import click\r\nmessage = click.edit()\r\n<\/pre>\nFuzzy Finder<\/strong><\/div>\nFuzzy Finder<\/span> \u662f\u4e00\u79cd\u901a\u8fc7\u5c11\u91cf\u8f93\u5165\u6765\u4e3a\u7528\u6237\u51cf\u5c11\u63a8\u8350\u7684\u65b9\u6cd5\u3002\u5e78\u8fd0\u7684\u662f\uff0c\u6709\u4e00\u4e2a\u5e93\u53ef\u4ee5\u5b9e\u73b0 Fuzzy Finder<\/span> \u3002\u8ba9\u6211\u4eec\u9996\u5148\u5b89\u88c5\u8fd9\u4e2a\u5e93\uff1a<\/p>\n
pip install fuzzyfinder\r\n<\/pre>\nFuzzy Finder\u7684 API \u5f88\u7b80\u5355\u3002\u7528\u6237\u5411\u5b83\u4f20\u9012\u90e8\u5206\u5b57\u7b26\u4e32\u548c\u4e00\u7cfb\u5217\u53ef\u80fd\u7684\u9009\u62e9\uff0c\u7136\u540e\uff0cFuzzy Finder\u5c06\u4f1a\u8fd4\u56de\u4e00\u4e2a\u4e0e\u90e8\u5206\u5b57\u7b26\u4e32\u5339\u914d\u7684\u5217\u8868\uff0c\u8fd9\u4e00\u5217\u8868\u662f\u901a\u8fc7\u6a21\u7cca\u7b97\u6cd5\u6839\u636e\u76f8\u5173\u6027\u6392\u5e8f\u5f97\u51fa\u7684\u3002\u6bd4\u5982\uff1a<\/p>\n
>>> from fuzzyfinder import fuzzyfinder\r\n\r\n>>> suggestions = fuzzyfinder('abc', ['abcd', 'defabca', 'aagbec', 'xyz', 'qux'])\r\n\r\n>>> list(suggestions)\r\n['abcd', 'defabca', 'aagbec']\r\n<\/pre>\n\u73b0\u5728\u6211\u4eec\u6709\u4e86fuzzyfinder>\uff0c\u8ba9\u6211\u4eec\u628a\u5b83\u52a0\u5165\u5230\u6211\u4eec\u7684 SQL REPL \u4e2d\u3002\u65b9\u6cd5\u662f\u6211\u4eec\u81ea\u5b9a\u4e49\u4e00\u4e2acompleter\u800c\u4e0d\u662f\u4f7f\u7528\u6765\u81eaprompt-toolkit\u5e93\u7684WordCompleter\u3002\u6bd4\u5982\uff1a<\/p>\n
from prompt_toolkit import prompt\r\nfrom prompt_toolkit.history import FileHistory\r\nfrom prompt_toolkit.auto_suggest import AutoSuggestFromHistory\r\nfrom prompt_toolkit.completion import Completer, Completion\r\nimport click\r\nfrom fuzzyfinder import fuzzyfinder\r\n\r\nSQLKeywords = ['select', 'from', 'insert', 'update', 'delete', 'drop']\r\n\r\nclass SQLCompleter(Completer):\r\n def get_completions(self, document, complete_event):\r\n word_before_cursor = document.get_word_before_cursor(WORD=True)\r\n matches = fuzzyfinder(word_before_cursor, SQLKeywords)\r\n for m in matches:\r\n yield Completion(m, start_position=-len(word_before_cursor))\r\n\r\nwhile 1:\r\n user_input = prompt(u'SQL>',\r\n history=FileHistory('history.txt'),\r\n auto_suggest=AutoSuggestFromHistory(),\r\n completer=SQLCompleter(),\r\n )\r\n click.echo_via_pager(user_input)\r\n<\/pre>\nPygments<\/strong><\/div>\n\u73b0\u5728\uff0c\u8ba9\u6211\u4eec\u7ed9\u7528\u6237\u8f93\u5165\u6dfb\u52a0\u8bed\u6cd5\u9ad8\u4eae\u3002\u6211\u4eec\u6b63\u5728\u642d\u5efa\u4e00\u4e2a SQL REPL\uff0c\u5982\u679c\u5177\u6709\u5f69\u8272\u9ad8\u4eae\u7684 SQL \u8bed\u53e5\uff0c\u8fd9\u4f1a\u5f88\u68d2\u3002<\/p>\n
Pygments\u662f\u4e00\u4e2a\u63d0\u4f9b\u8bed\u6cd5\u9ad8\u4eae\u7684\u5e93\uff0c\u5185\u5efa\u652f\u6301\u8d85\u8fc7 300 \u79cd\u8bed\u8a00\u3002\u6dfb\u52a0\u8bed\u6cd5\u9ad8\u4eae\u80fd\u591f\u4f7f\u5e94\u7528\u53d8\u5f97\u5f69\u8272\u5316\uff0c\u4ece\u800c\u80fd\u591f\u5e2e\u52a9\u7528\u6237\u5728\u6267\u884c\u7a0b\u5e8f\u524d\u53d1\u73b0 SQL \u4e2d\u5b58\u5728\u7684\u9519\u8bef\uff0c\u6bd4\u5982\u62fc\u5199\u9519\u8bef\u3001\u5f15\u53f7\u4e0d\u5339\u914d\u6216\u62ec\u53f7\u4e0d\u5339\u914d\u3002<\/p>\n
\u9996\u5148\uff0c\u5b89\u88c5Pygments\uff1a<\/p>\n
pip install pygments\r\n<\/pre>\n\u8ba9\u6211\u4eec\u4f7f\u7528Pygments\u6765\u4e3a SQL REPL \u6dfb\u52a0\u989c\u8272\uff1a<\/p>\n
from prompt_toolkit import prompt\r\nfrom prompt_toolkit.history import FileHistory\r\nfrom prompt_toolkit.auto_suggest import AutoSuggestFromHistory\r\nfrom prompt_toolkit.completion import Completer, Completion\r\nimport click\r\nfrom fuzzyfinder import fuzzyfinder\r\nfrom pygments.lexers.sql import SqlLexer\r\n\r\nSQLKeywords = ['select', 'from', 'insert', 'update', 'delete', 'drop']\r\n\r\nclass SQLCompleter(Completer):\r\n def get_completions(self, document, complete_event):\r\n word_before_cursor = document.get_word_before_cursor(WORD=True)\r\n matches = fuzzyfinder(word_before_cursor, SQLKeywords)\r\n for m in matches:\r\n yield Completion(m, start_position=-len(word_before_cursor))\r\n\r\nwhile 1:\r\n user_input = prompt(u'SQL>',\r\n history=FileHistory('history.txt'),\r\n auto_suggest=AutoSuggestFromHistory(),\r\n completer=SQLCompleter(),\r\n lexer=SqlLexer,\r\n )\r\n click.echo_via_pager(user_input)\r\n<\/pre>\nPrompt Toolkit\u80fd\u591f\u548cPygments\u4e00\u540c\u5f88\u597d\u7684\u5de5\u4f5c\u3002\u6211\u4eec\u628aPygments\u63d0\u4f9b\u7684SqlLexer\u52a0\u5165\u5230\u6765\u81eaprompt-toolkit\u7684prompt\u4e2d\u3002\u73b0\u5728\uff0c\u6240\u6709\u7684\u7528\u6237\u8f93\u5165\u90fd\u4f1a\u88ab\u5f53\u4f5c SQL \u8bed\u53e5\uff0c\u5e76\u8fdb\u884c\u9002\u5f53\u7740\u8272\u3002<\/p>\n
\u7ed3\u8bba<\/strong><\/div>\n\u6211\u4eec\u7684\u201c\u65c5\u9014\u201d\u901a\u8fc7\u521b\u5efa\u4e00\u4e2a\u5f3a\u5927\u7684 REPL \u7ed3\u675f\uff0c\u8fd9\u4e2a REPL \u5177\u6709\u5e38\u89c1\u7684 shell \u7684\u5168\u90e8\u7279\u6027\uff0c\u6bd4\u5982\u5386\u53f2\u547d\u4ee4\uff0c\u952e\u4f4d\u7ed1\u5b9a\uff0c\u7528\u6237\u53cb\u597d\u6027\u6bd4\u5982\u81ea\u52a8\u8865\u5168\u3001\u6a21\u7cca\u67e5\u627e\u3001\u5206\u9875\u5668\u652f\u6301\u3001\u7f16\u8f91\u5668\u652f\u6301\u548c\u8bed\u6cd5\u9ad8\u4eae\u3002\u6211\u4eec\u4ec5\u7528\u5c11\u4e8e 20 \u884c Python \u4ee3\u7801\u5c31\u5b9e\u73b0\u4e86\u8fd9\u4e2a REPL \u3002<\/p>\n
\u4e0d\u662f\u5f88\u7b80\u5355\u5417\uff1f\u73b0\u5728\uff0c\u4f60\u6ca1\u6709\u7406\u7531\u4e0d\u4f1a\u5199\u4e00\u4e2a\u81ea\u5df1\u7684\u547d\u4ee4\u884c\u5e94\u7528\u4e86\u3002<\/p>\n
\nvia: https:\/\/opensource.com\/article\/17\/5\/4-practical-python-libraries<\/a><\/p>\n
\u4f5c\u8005\uff1aAmjith Ramanujam<\/a> \u8bd1\u8005\uff1aucasFL<\/a> \u6821\u5bf9\uff1awxy<\/a><\/p>\n
\u672c\u6587\u7531 LCTT<\/a> \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd<\/a> \u8363\u8a89\u63a8\u51fa<\/p>\n
\n\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-8561-1.html<\/a><\/p>\n