{"id":931580,"date":"2024-12-26T17:39:25","date_gmt":"2024-12-26T09:39:25","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/931580.html"},"modified":"2024-12-26T17:39:26","modified_gmt":"2024-12-26T09:39:26","slug":"python%e5%a6%82%e4%bd%95%e5%90%af%e5%8a%a8ipython","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/931580.html","title":{"rendered":"python\u5982\u4f55\u542f\u52a8ipython"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25065816\/cf29d8b9-a316-420d-b20c-2cfcc38f4b3d.webp\" alt=\"python\u5982\u4f55\u542f\u52a8ipython\" \/><\/p>\n<p><p> <strong>Python\u542f\u52a8IPython\u7684\u65b9\u6cd5\u6709\u591a\u79cd\u3001\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u901a\u8fc7\u547d\u4ee4\u884c\u7ec8\u7aef\u542f\u52a8\u3001\u6216\u8005\u901a\u8fc7\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u542f\u52a8\u3002\u5728\u547d\u4ee4\u884c\u7ec8\u7aef\u4e2d\uff0c\u53ea\u9700\u8f93\u5165\u547d\u4ee4\u201cipython\u201d\u5e76\u56de\u8f66\u5373\u53ef\u542f\u52a8\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u542f\u52a8IPython\u662fPython\u5f00\u53d1\u4eba\u5458\u5e38\u7528\u7684\u64cd\u4f5c\uff0c\u56e0\u4e3aIPython\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5f3a\u5927\u7684\u4ea4\u4e92\u5f0f\u73af\u5883\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u6267\u884cPython\u4ee3\u7801\u3001\u8c03\u8bd5\u7a0b\u5e8f\u548c\u8fdb\u884c\u6570\u636e\u5206\u6790\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5982\u4f55\u542f\u52a8IPython\u4ee5\u53ca\u4e00\u4e9b\u5e38\u89c1\u7684\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u901a\u8fc7\u547d\u4ee4\u884c\u7ec8\u7aef\u542f\u52a8IPython<\/p>\n<\/p>\n<p><p>1\u3001\u5b89\u88c5IPython<\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86IPython\u3002\u53ef\u4ee5\u4f7f\u7528Python\u7684\u5305\u7ba1\u7406\u5de5\u5177pip\u6765\u5b89\u88c5\u3002\u5728\u547d\u4ee4\u884c\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install ipython<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u786e\u4fdd\u5b89\u88c5\u6210\u529f\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u786e\u8ba4IPython\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">ipython --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>2\u3001\u542f\u52a8IPython<\/p>\n<\/p>\n<p><p>\u5728\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u76f4\u63a5\u5728\u547d\u4ee4\u884c\u7ec8\u7aef\u4e2d\u8f93\u5165<code>ipython<\/code>\u5e76\u6309\u56de\u8f66\u952e\uff0c\u5373\u53ef\u542f\u52a8IPython\u3002\u8fd9\u5c06\u5728\u7ec8\u7aef\u4e2d\u6253\u5f00\u4e00\u4e2a\u4ea4\u4e92\u5f0fShell\uff0c\u60a8\u53ef\u4ee5\u5728\u5176\u4e2d\u8f93\u5165Python\u4ee3\u7801\u5e76\u7acb\u5373\u67e5\u770b\u8f93\u51fa\u3002<\/p>\n<\/p>\n<p><p>3\u3001\u9000\u51faIPython<\/p>\n<\/p>\n<p><p>\u8981\u9000\u51faIPython\uff0c\u53ef\u4ee5\u8f93\u5165<code>exit<\/code>\u6216\u4f7f\u7528\u5feb\u6377\u952e<code>Ctrl-D<\/code>\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u901a\u8fc7\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u542f\u52a8IPython<\/p>\n<\/p>\n<p><p>1\u3001Jupyter Notebook<\/p>\n<\/p>\n<p><p>Jupyter Notebook\u662f\u4e00\u4e2a\u975e\u5e38\u6d41\u884c\u7684\u57fa\u4e8eWeb\u7684IDE\uff0c\u5185\u7f6e\u4e86IPython\u5185\u6838\uff0c\u9002\u5408\u8fdb\u884c\u6570\u636e\u79d1\u5b66\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u7b49\u5de5\u4f5c\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8Jupyter Notebook\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">jupyter notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u6253\u5f00\u4e00\u4e2a\u65b0\u7684\u6d4f\u89c8\u5668\u7a97\u53e3\uff0c\u60a8\u53ef\u4ee5\u5728\u5176\u4e2d\u521b\u5efa\u548c\u7ba1\u7406\u7b14\u8bb0\u672c\u6587\u4ef6\uff0c\u76f4\u63a5\u6267\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>2\u3001\u4f7f\u7528PyCharm<\/p>\n<\/p>\n<p><p>PyCharm\u662f\u53e6\u4e00\u4e2a\u6d41\u884c\u7684Python IDE\uff0c\u652f\u6301IPython\u63a7\u5236\u53f0\u3002\u5728PyCharm\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u9009\u62e9\u201cView\u201d\u83dc\u5355\uff0c\u7136\u540e\u9009\u62e9\u201cTool Windows\u201d\u4e2d\u7684\u201cPython Console\u201d\u6765\u542f\u52a8IPython\u63a7\u5236\u53f0\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001IPython\u7684\u57fa\u672c\u529f\u80fd\u4ecb\u7ecd<\/p>\n<\/p>\n<p><p>1\u3001\u81ea\u52a8\u8865\u5168\u548c\u63d0\u793a<\/p>\n<\/p>\n<p><p>IPython\u63d0\u4f9b\u4e86\u81ea\u52a8\u8865\u5168\u529f\u80fd\uff0c\u5f53\u60a8\u8f93\u5165\u53d8\u91cf\u540d\u6216\u51fd\u6570\u540d\u7684\u5f00\u5934\u65f6\uff0c\u53ef\u4ee5\u6309\u4e0b<code>Tab<\/code>\u952e\u8fdb\u884c\u8865\u5168\u3002\u6b64\u5916\uff0c\u8f93\u5165<code>?<\/code>\u53ef\u4ee5\u67e5\u770b\u5bf9\u8c61\u7684\u6587\u6863\u5b57\u7b26\u4e32\uff0c\u8f93\u5165<code>??<\/code>\u53ef\u4ee5\u67e5\u770b\u5bf9\u8c61\u7684\u6e90\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>2\u3001\u9b54\u6cd5\u547d\u4ee4<\/p>\n<\/p>\n<p><p>IPython\u6709\u4e00\u7ec4\u79f0\u4e3a\u201c\u9b54\u6cd5\u547d\u4ee4\u201d\u7684\u7279\u6b8a\u547d\u4ee4\uff0c\u8fd9\u4e9b\u547d\u4ee4\u4ee5\u201c%\u201d\u5f00\u5934\uff0c\u7528\u4e8e\u6267\u884c\u7279\u5b9a\u7684\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c<code>%timeit<\/code>\u53ef\u4ee5\u7528\u4e8e\u6d4b\u91cf\u4ee3\u7801\u7684\u6267\u884c\u65f6\u95f4\uff0c<code>%run<\/code>\u53ef\u4ee5\u8fd0\u884cPython\u811a\u672c\u3002<\/p>\n<\/p>\n<p><p>3\u3001\u5386\u53f2\u8bb0\u5f55<\/p>\n<\/p>\n<p><p>IPython\u4f1a\u81ea\u52a8\u4fdd\u5b58\u8f93\u5165\u7684\u547d\u4ee4\u5386\u53f2\uff0c\u53ef\u4ee5\u901a\u8fc7\u6309\u4e0a\u4e0b\u7bad\u5934\u952e\u5feb\u901f\u6d4f\u89c8\u548c\u91cd\u590d\u4f7f\u7528\u4e4b\u524d\u7684\u547d\u4ee4\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001IPython\u5728\u6570\u636e\u79d1\u5b66\u4e2d\u7684\u5e94\u7528<\/p>\n<\/p>\n<p><p>1\u3001\u6570\u636e\u5206\u6790<\/p>\n<\/p>\n<p><p>IPython\u4e0e\u8bf8\u5982NumPy\u3001Pandas\u7b49\u79d1\u5b66\u8ba1\u7b97\u5e93\u65e0\u7f1d\u96c6\u6210\uff0c\u4f7f\u5f97\u6570\u636e\u5206\u6790\u53d8\u5f97\u66f4\u52a0\u9ad8\u6548\u3002\u53ef\u4ee5\u5728IPython\u4e2d\u5feb\u901f\u52a0\u8f7d\u548c\u64cd\u4f5c\u6570\u636e\u96c6\uff0c\u5e76\u4f7f\u7528\u7ed8\u56fe\u5e93\u5982Matplotlib\u8fdb\u884c\u6570\u636e\u53ef\u89c6\u5316\u3002<\/p>\n<\/p>\n<p><p>2\u3001\u4ea4\u4e92\u5f0f\u8ba1\u7b97<\/p>\n<\/p>\n<p><p>IPython\u652f\u6301\u4ea4\u4e92\u5f0f\u8ba1\u7b97\uff0c\u53ef\u4ee5\u5728\u6267\u884c\u4ee3\u7801\u7684\u8fc7\u7a0b\u4e2d\u5373\u65f6\u67e5\u770b\u7ed3\u679c\u5e76\u8fdb\u884c\u8c03\u6574\u3002\u8fd9\u5bf9\u4e8e\u63a2\u7d22\u6027\u6570\u636e\u5206\u6790\u975e\u5e38\u6709\u7528\uff0c\u53ef\u4ee5\u5feb\u901f\u6d4b\u8bd5\u4e0d\u540c\u7684\u5047\u8bbe\u548c\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>3\u3001\u96c6\u6210\u7ed8\u56fe<\/p>\n<\/p>\n<p><p>IPython\u4e0eMatplotlib\u7b49\u7ed8\u56fe\u5e93\u96c6\u6210\u826f\u597d\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u663e\u793a\u56fe\u5f62\u3002\u800c\u5728Jupyter Notebook\u4e2d\uff0c\u56fe\u5f62\u53ef\u4ee5\u5d4c\u5165\u5230\u7b14\u8bb0\u672c\u4e2d\uff0c\u4fbf\u4e8e\u5206\u4eab\u548c\u5c55\u793a\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001IPython\u7684\u9ad8\u7ea7\u529f\u80fd<\/p>\n<\/p>\n<p><p>1\u3001\u5e76\u884c\u8ba1\u7b97<\/p>\n<\/p>\n<p><p>IPython\u652f\u6301\u5e76\u884c\u8ba1\u7b97\u6846\u67b6\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a\u5904\u7406\u5668\u6765\u52a0\u901f\u8ba1\u7b97\u4efb\u52a1\u3002\u901a\u8fc7<code>ipyparallel<\/code>\u5e93\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06\u8ba1\u7b97\u4efb\u52a1\u5206\u53d1\u5230\u591a\u4e2a\u6838\u5fc3\u4e0a\u6267\u884c\u3002<\/p>\n<\/p>\n<p><p>2\u3001\u81ea\u5b9a\u4e49\u6269\u5c55<\/p>\n<\/p>\n<p><p>IPython\u5141\u8bb8\u7528\u6237\u7f16\u5199\u81ea\u5b9a\u4e49\u6269\u5c55\uff0c\u6269\u5c55IPython\u7684\u529f\u80fd\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u7f16\u5199IPython\u6269\u5c55\u6a21\u5757\u6765\u5b9e\u73b0\uff0c\u6269\u5c55\u6a21\u5757\u53ef\u4ee5\u6ce8\u518c\u65b0\u7684\u9b54\u6cd5\u547d\u4ee4\u6216\u6539\u53d8IPython\u7684\u884c\u4e3a\u3002<\/p>\n<\/p>\n<p><p>3\u3001\u96c6\u6210\u5de5\u5177<\/p>\n<\/p>\n<p><p>IPython\u53ef\u4ee5\u4e0e\u8bb8\u591a\u5176\u4ed6\u5de5\u5177\u96c6\u6210\uff0c\u5982R\u8bed\u8a00\uff0c\u901a\u8fc7<code>rpy2<\/code>\u5e93\u53ef\u4ee5\u5728IPython\u4e2d\u76f4\u63a5\u8c03\u7528R\u51fd\u6570\uff0c\u5b9e\u73b0\u8de8\u8bed\u8a00\u7684\u6df7\u5408\u8ba1\u7b97\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001IPython\u7684\u914d\u7f6e\u4e0e\u4f18\u5316<\/p>\n<\/p>\n<p><p>1\u3001\u914d\u7f6e\u6587\u4ef6<\/p>\n<\/p>\n<p><p>IPython\u5141\u8bb8\u7528\u6237\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u81ea\u5b9a\u4e49\u5176\u884c\u4e3a\u548c\u5916\u89c2\u3002\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4<code>ipython profile create<\/code>\u521b\u5efa\u914d\u7f6e\u6587\u4ef6\uff0c\u7136\u540e\u7f16\u8f91\u751f\u6210\u7684\u914d\u7f6e\u6587\u4ef6\u6765\u8c03\u6574\u8bbe\u7f6e\u3002<\/p>\n<\/p>\n<p><p>2\u3001\u6027\u80fd\u4f18\u5316<\/p>\n<\/p>\n<p><p>\u5728\u5904\u7406\u5927\u6570\u636e\u96c6\u6216\u590d\u6742\u8ba1\u7b97\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528IPython\u7684\u6027\u80fd\u5206\u6790\u5de5\u5177\u6765\u8bc6\u522b\u74f6\u9888\uff0c\u5e76\u901a\u8fc7\u4f18\u5316\u7b97\u6cd5\u6216\u4ee3\u7801\u7ed3\u6784\u6765\u63d0\u5347\u6027\u80fd\u3002<\/p>\n<\/p>\n<p><p>3\u3001\u73af\u5883\u7ba1\u7406<\/p>\n<\/p>\n<p><p>IPython\u53ef\u4ee5\u4e0ePython\u7684\u865a\u62df\u73af\u5883\u5de5\u5177\uff0c\u5982<code>virtualenv<\/code>\u6216<code>conda<\/code>\u7ed3\u5408\u4f7f\u7528\uff0c\u4fbf\u4e8e\u7ba1\u7406\u4e0d\u540c\u9879\u76ee\u6240\u9700\u7684\u4f9d\u8d56\u5e93\u3002<\/p>\n<\/p>\n<p><p>\u4e03\u3001IPython\u7684\u793e\u533a\u4e0e\u8d44\u6e90<\/p>\n<\/p>\n<p><p>1\u3001\u793e\u533a\u652f\u6301<\/p>\n<\/p>\n<p><p>IPython\u6709\u4e00\u4e2a\u6d3b\u8dc3\u7684\u793e\u533a\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u5728\u7ebf\u8bba\u575b\u3001\u8ba8\u8bba\u7ec4\u548c\u793e\u4ea4\u5a92\u4f53\u4e0e\u5176\u4ed6\u7528\u6237\u4ea4\u6d41\u7ecf\u9a8c\u548c\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><p>2\u3001\u5b66\u4e60\u8d44\u6e90<\/p>\n<\/p>\n<p><p>\u6709\u4e30\u5bcc\u7684\u5728\u7ebf\u6559\u7a0b\u3001\u6587\u6863\u548c\u4e66\u7c4d\u53ef\u4f9b\u5b66\u4e60IPython\u7684\u4f7f\u7528\u548c\u6700\u4f73\u5b9e\u8df5\u3002\u5b98\u65b9\u6587\u6863\u63d0\u4f9b\u4e86\u8be6\u7ec6\u7684API\u8bf4\u660e\u548c\u4f7f\u7528\u793a\u4f8b\uff0c\u662f\u5b66\u4e60\u7684\u826f\u597d\u8d77\u70b9\u3002<\/p>\n<\/p>\n<p><p>3\u3001\u66f4\u65b0\u4e0e\u53d1\u5c55<\/p>\n<\/p>\n<p><p>IPython\u4f5c\u4e3a\u5f00\u6e90\u9879\u76ee\uff0c\u5b9a\u671f\u53d1\u5e03\u65b0\u7248\u672c\uff0c\u4fee\u590dbug\u5e76\u6dfb\u52a0\u65b0\u529f\u80fd\u3002\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u53c2\u4e0e\u793e\u533a\u8d21\u732e\u529b\u91cf\uff0c\u5e2e\u52a9\u6539\u8fdbIPython\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u5185\u5bb9\u7684\u4ecb\u7ecd\uff0c\u5e0c\u671b\u80fd\u591f\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7406\u89e3\u548c\u4f7f\u7528IPython\uff0c\u5e76\u5728\u5b9e\u9645\u5de5\u4f5c\u4e2d\u63d0\u9ad8\u6548\u7387\u548c\u751f\u4ea7\u529b\u3002IPython\u4e0d\u4ec5\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u4e5f\u662fPython\u751f\u6001\u7cfb\u7edf\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u4e00\u90e8\u5206\u3002\u65e0\u8bba\u60a8\u662f\u6570\u636e\u79d1\u5b66\u5bb6\u3001\u8f6f\u4ef6\u5de5\u7a0b\u5e08\u8fd8\u662f\u6559\u80b2\u5de5\u4f5c\u8005\uff0cIPython\u90fd\u53ef\u4ee5\u4e3a\u60a8\u7684\u5de5\u4f5c\u5e26\u6765\u6781\u5927\u7684\u4fbf\u5229\u548c\u53ef\u80fd\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u542f\u52a8IPython\uff1f<\/strong><br \/>\u5728Windows\u3001macOS\u548cLinux\u7b49\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u542f\u52a8IPython\u7684\u65b9\u6cd5\u7565\u6709\u4e0d\u540c\u3002\u5bf9\u4e8eWindows\u7528\u6237\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u63d0\u793a\u7b26\u6216Anaconda Prompt\u8f93\u5165<code>ipython<\/code>\u6765\u542f\u52a8\u3002\u800c\u5728macOS\u548cLinux\u4e2d\uff0c\u7528\u6237\u53ea\u9700\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u76f8\u540c\u7684\u547d\u4ee4\u5373\u53ef\u3002\u5982\u679c\u60a8\u4f7f\u7528Anaconda\uff0c\u786e\u4fdd\u5728Anaconda Navigator\u4e2d\u9009\u62e9IPython\u6216\u5728\u7ec8\u7aef\u4e2d\u6fc0\u6d3b\u76f8\u5e94\u7684\u73af\u5883\u540e\u518d\u8f93\u5165\u547d\u4ee4\u3002<\/p>\n<p><strong>IPython\u548c\u666e\u901aPython\u89e3\u91ca\u5668\u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/strong><br \/>IPython\u63d0\u4f9b\u4e86\u6bd4\u6807\u51c6Python\u89e3\u91ca\u5668\u66f4\u4e30\u5bcc\u7684\u4ea4\u4e92\u4f53\u9a8c\u3002\u5b83\u652f\u6301\u8bed\u6cd5\u9ad8\u4eae\u3001\u81ea\u52a8\u8865\u5168\u3001\u4e30\u5bcc\u7684\u5185\u7f6e\u9b54\u6cd5\u547d\u4ee4\u4ee5\u53ca\u66f4\u597d\u7684\u8c03\u8bd5\u5de5\u5177\u3002\u8fd9\u4f7f\u5f97\u6570\u636e\u79d1\u5b66\u5bb6\u548c\u5f00\u53d1\u8005\u5728\u8fdb\u884c\u6570\u636e\u5206\u6790\u548c\u5b9e\u9a8c\u65f6\uff0c\u80fd\u591f\u66f4\u52a0\u9ad8\u6548\u5730\u7f16\u5199\u548c\u6d4b\u8bd5\u4ee3\u7801\u3002<\/p>\n<p><strong>\u5728IPython\u4e2d\u5982\u4f55\u4f7f\u7528\u9b54\u6cd5\u547d\u4ee4\uff1f<\/strong><br \/>\u9b54\u6cd5\u547d\u4ee4\u662fIPython\u7684\u4e00\u4e2a\u72ec\u7279\u7279\u6027\uff0c\u5141\u8bb8\u7528\u6237\u6267\u884c\u7279\u5b9a\u529f\u80fd\u3002\u4f7f\u7528<code>%<\/code>\u7b26\u53f7\u53ef\u4ee5\u8c03\u7528\u5355\u884c\u9b54\u6cd5\u547d\u4ee4\uff0c\u4f8b\u5982<code>%timeit<\/code>\u7528\u4e8e\u6d4b\u91cf\u4ee3\u7801\u6267\u884c\u65f6\u95f4\u3002\u591a\u884c\u9b54\u6cd5\u547d\u4ee4\u5219\u4ee5<code>%%<\/code>\u5f00\u5934\uff0c\u4f8b\u5982<code>%%writefile<\/code>\u7528\u4e8e\u5c06\u4ee3\u7801\u5199\u5165\u6587\u4ef6\u3002\u8981\u67e5\u770b\u53ef\u7528\u7684\u9b54\u6cd5\u547d\u4ee4\uff0c\u53ef\u4ee5\u5728IPython\u4e2d\u8f93\u5165<code>%lsmagic<\/code>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u542f\u52a8IPython\u7684\u65b9\u6cd5\u6709\u591a\u79cd\u3001\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u901a\u8fc7\u547d\u4ee4\u884c\u7ec8\u7aef\u542f\u52a8\u3001\u6216\u8005\u901a\u8fc7\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u542f [&hellip;]","protected":false},"author":3,"featured_media":931583,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/931580"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=931580"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/931580\/revisions"}],"predecessor-version":[{"id":931584,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/931580\/revisions\/931584"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/931583"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=931580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=931580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=931580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}