{"id":1180143,"date":"2025-01-15T18:33:12","date_gmt":"2025-01-15T10:33:12","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1180143.html"},"modified":"2025-01-15T18:33:15","modified_gmt":"2025-01-15T10:33:15","slug":"%e5%a6%82%e4%bd%95%e8%b0%83%e5%a4%a7python%e7%9a%84%e5%ad%97%e4%bd%93","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1180143.html","title":{"rendered":"\u5982\u4f55\u8c03\u5927python\u7684\u5b57\u4f53"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25114349\/e5b0f27e-a333-47a4-bdce-12980d0fe24e.webp\" alt=\"\u5982\u4f55\u8c03\u5927python\u7684\u5b57\u4f53\" \/><\/p>\n<p><p> <strong>\u8c03\u5927Python\u5b57\u4f53\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u4ee3\u7801\u7f16\u8f91\u5668\u7684\u8bbe\u7f6e\u3001\u4fee\u6539\u7ec8\u7aef\u5b57\u4f53\u5927\u5c0f\u3001\u4f7f\u7528\u7279\u5b9a\u7684IDE\u6216\u6587\u672c\u7f16\u8f91\u5668\u3001\u8c03\u6574\u64cd\u4f5c\u7cfb\u7edf\u7684\u663e\u793a\u8bbe\u7f6e\u6765\u5b9e\u73b0<\/strong>\u3002\u5176\u4e2d\uff0c<strong>\u901a\u8fc7\u8c03\u6574\u4ee3\u7801\u7f16\u8f91\u5668\u7684\u8bbe\u7f6e<\/strong>\u662f\u6700\u5e38\u7528\u4e14\u6700\u6709\u6548\u7684\u65b9\u6cd5\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728\u4e0d\u540c\u7684\u7f16\u8f91\u5668\u548c\u73af\u5883\u4e2d\u8c03\u5927Python\u7684\u5b57\u4f53\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5728\u4e0d\u540c\u7f16\u8f91\u5668\u4e2d\u8c03\u6574\u5b57\u4f53\u5927\u5c0f<\/h3>\n<\/p>\n<p><h4>1\u3001Visual Studio Code<\/h4>\n<\/p>\n<p><p>Visual Studio Code (VS Code) \u662f\u4e00\u4e2a\u975e\u5e38\u6d41\u884c\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u5b83\u5177\u6709\u9ad8\u5ea6\u53ef\u5b9a\u5236\u6027\u3002\u8c03\u6574VS Code\u4e2dPython\u5b57\u4f53\u5927\u5c0f\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00VS Code\uff0c\u70b9\u51fb\u5de6\u4e0b\u89d2\u9f7f\u8f6e\u56fe\u6807\u8fdb\u5165\u201c\u8bbe\u7f6e\u201d\u3002<\/li>\n<li>\u5728\u8bbe\u7f6e\u4e2d\u641c\u7d22\u201cFont Size\u201d\u3002<\/li>\n<li>\u5c06\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f\u8bbe\u7f6e\u4e3a\u4f60\u9700\u8981\u7684\u5927\u5c0f\uff0c\u901a\u5e38\u9ed8\u8ba4\u662f12\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8c03\u6574\u523014\u300116\u751a\u81f3\u66f4\u5927\u3002<\/li>\n<li>\u4fee\u6539\u5b8c\u6bd5\u540e\uff0c\u5173\u95ed\u8bbe\u7f6e\u7a97\u53e3\uff0c\u5b57\u4f53\u5927\u5c0f\u4f1a\u7acb\u5373\u751f\u6548\u3002<\/li>\n<\/ul>\n<p><h4>2\u3001PyCharm<\/h4>\n<\/p>\n<p><p>PyCharm\u662f\u4e00\u4e2a\u4e13\u4e1a\u7684Python IDE\uff0c\u8c03\u6574\u5176\u5b57\u4f53\u5927\u5c0f\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00PyCharm\uff0c\u70b9\u51fb\u9876\u90e8\u83dc\u5355\u680f\u7684\u201cFile\u201d\uff0c\u7136\u540e\u9009\u62e9\u201cSettings\u201d\u3002<\/li>\n<li>\u5728\u8bbe\u7f6e\u7a97\u53e3\u4e2d\uff0c\u5bfc\u822a\u5230\u201cEditor\u201d -&gt; \u201cFont\u201d\u3002<\/li>\n<li>\u5728\u5b57\u4f53\u8bbe\u7f6e\u9875\u9762\u4e2d\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u201cSize\u201d\u9009\u9879\uff0c\u8c03\u6574\u4e3a\u4f60\u9700\u8981\u7684\u5b57\u4f53\u5927\u5c0f\u3002<\/li>\n<li>\u70b9\u51fb\u201cApply\u201d\u7136\u540e\u201cOK\u201d\uff0c\u5b57\u4f53\u5927\u5c0f\u4f1a\u7acb\u5373\u751f\u6548\u3002<\/li>\n<\/ul>\n<p><h4>3\u3001Jupyter Notebook<\/h4>\n<\/p>\n<p><p>Jupyter Notebook \u662f\u4e00\u4e2a\u975e\u5e38\u6d41\u884c\u7684\u5de5\u5177\uff0c\u7528\u4e8e\u6570\u636e\u79d1\u5b66\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u3002\u8c03\u6574\u5176\u5b57\u4f53\u5927\u5c0f\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00Jupyter Notebook\uff0c\u70b9\u51fb\u9876\u90e8\u83dc\u5355\u680f\u7684\u201cView\u201d\u3002<\/li>\n<li>\u9009\u62e9\u201cCell Toolbar\u201d -&gt; \u201cEdit Metadata\u201d\u3002<\/li>\n<li>\u5728\u5355\u5143\u683c\u5143\u6570\u636e\u7f16\u8f91\u5668\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0bJSON\u4ee3\u7801\u6765\u8c03\u6574\u5b57\u4f53\u5927\u5c0f\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-json\">{<\/p>\n<p>  &quot;tags&quot;: [],<\/p>\n<p>  &quot;cell_type&quot;: &quot;markdown&quot;,<\/p>\n<p>  &quot;metadata&quot;: {<\/p>\n<p>    &quot;font_size&quot;: &quot;18px&quot;<\/p>\n<p>  }<\/p>\n<p>}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ul>\n<li>\u4fdd\u5b58\u540e\uff0c\u5173\u95ed\u5143\u6570\u636e\u7f16\u8f91\u5668\uff0c\u5b57\u4f53\u5927\u5c0f\u4f1a\u7acb\u5373\u751f\u6548\u3002<\/li>\n<\/ul>\n<p><h3>\u4e8c\u3001\u4fee\u6539\u7ec8\u7aef\u5b57\u4f53\u5927\u5c0f<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u662f\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884cPython\u811a\u672c\uff0c\u90a3\u4e48\u8c03\u6574\u7ec8\u7aef\u7684\u5b57\u4f53\u5927\u5c0f\u4e5f\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u6b65\u9aa4\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7ec8\u7aef\u7684\u5b57\u4f53\u8c03\u6574\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h4>1\u3001Windows Terminal<\/h4>\n<\/p>\n<ul>\n<li>\u6253\u5f00Windows Terminal\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u4e0b\u62c9\u7bad\u5934\u56fe\u6807\uff0c\u7136\u540e\u9009\u62e9\u201cSettings\u201d\u3002<\/li>\n<li>\u5728\u8bbe\u7f6e\u4e2d\uff0c\u627e\u5230\u201cProfiles\u201d -&gt; \u201cDefaults\u201d\u3002<\/li>\n<li>\u5728\u201cAppearance\u201d\u9009\u9879\u5361\u4e2d\uff0c\u627e\u5230\u201cFont size\u201d\uff0c\u8c03\u6574\u4e3a\u4f60\u9700\u8981\u7684\u5b57\u4f53\u5927\u5c0f\u3002<\/li>\n<li>\u4fdd\u5b58\u8bbe\u7f6e\uff0c\u7ec8\u7aef\u5b57\u4f53\u5927\u5c0f\u4f1a\u7acb\u5373\u751f\u6548\u3002<\/li>\n<\/ul>\n<p><h4>2\u3001macOS Terminal<\/h4>\n<\/p>\n<ul>\n<li>\u6253\u5f00macOS Terminal\uff0c\u70b9\u51fb\u9876\u90e8\u83dc\u5355\u680f\u7684\u201cTerminal\u201d\uff0c\u7136\u540e\u9009\u62e9\u201cPreferences\u201d\u3002<\/li>\n<li>\u5728\u8bbe\u7f6e\u7a97\u53e3\u4e2d\uff0c\u9009\u62e9\u4f60\u6b63\u5728\u4f7f\u7528\u7684\u914d\u7f6e\u6587\u4ef6\uff08\u5982\u201cBasic\u201d\uff09\u3002<\/li>\n<li>\u5728\u201cText\u201d\u9009\u9879\u5361\u4e2d\uff0c\u627e\u5230\u201cFont\u201d\u9009\u9879\uff0c\u70b9\u51fb\u201cChange\u201d\u6309\u94ae\u3002<\/li>\n<li>\u5728\u5f39\u51fa\u7684\u5b57\u4f53\u9009\u62e9\u7a97\u53e3\u4e2d\uff0c\u9009\u62e9\u4f60\u9700\u8981\u7684\u5b57\u4f53\u5927\u5c0f\u3002<\/li>\n<li>\u5173\u95ed\u8bbe\u7f6e\u7a97\u53e3\uff0c\u5b57\u4f53\u5927\u5c0f\u4f1a\u7acb\u5373\u751f\u6548\u3002<\/li>\n<\/ul>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u7279\u5b9a\u7684IDE\u6216\u6587\u672c\u7f16\u8f91\u5668<\/h3>\n<\/p>\n<p><p>\u4e0d\u540c\u7684IDE\u6216\u6587\u672c\u7f16\u8f91\u5668\u5177\u6709\u4e0d\u540c\u7684\u5b57\u4f53\u8c03\u6574\u65b9\u6cd5\uff0c\u4f46\u5927\u591a\u6570\u90fd\u63d0\u4f9b\u4e86\u76f4\u63a5\u5728\u8bbe\u7f6e\u4e2d\u8c03\u6574\u5b57\u4f53\u5927\u5c0f\u7684\u529f\u80fd\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684IDE\u548c\u6587\u672c\u7f16\u8f91\u5668\u7684\u8c03\u6574\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h4>1\u3001Sublime Text<\/h4>\n<\/p>\n<ul>\n<li>\u6253\u5f00Sublime Text\uff0c\u70b9\u51fb\u9876\u90e8\u83dc\u5355\u680f\u7684\u201cPreferences\u201d\uff0c\u7136\u540e\u9009\u62e9\u201cSettings\u201d\u3002<\/li>\n<li>\u5728\u8bbe\u7f6e\u6587\u4ef6\u4e2d\uff0c\u627e\u5230\u201cfont_size\u201d\u9009\u9879\uff0c\u8c03\u6574\u4e3a\u4f60\u9700\u8981\u7684\u5b57\u4f53\u5927\u5c0f\u3002<\/li>\n<li>\u4fdd\u5b58\u8bbe\u7f6e\u6587\u4ef6\uff0c\u5b57\u4f53\u5927\u5c0f\u4f1a\u7acb\u5373\u751f\u6548\u3002<\/li>\n<\/ul>\n<p><h4>2\u3001Atom<\/h4>\n<\/p>\n<ul>\n<li>\u6253\u5f00Atom\uff0c\u70b9\u51fb\u9876\u90e8\u83dc\u5355\u680f\u7684\u201cFile\u201d\uff0c\u7136\u540e\u9009\u62e9\u201cSettings\u201d\u3002<\/li>\n<li>\u5728\u8bbe\u7f6e\u7a97\u53e3\u4e2d\uff0c\u5bfc\u822a\u5230\u201cEditor\u201d\u3002<\/li>\n<li>\u5728\u201cEditor\u201d\u9009\u9879\u5361\u4e2d\uff0c\u627e\u5230\u201cFont Size\u201d\u9009\u9879\uff0c\u8c03\u6574\u4e3a\u4f60\u9700\u8981\u7684\u5b57\u4f53\u5927\u5c0f\u3002<\/li>\n<li>\u5173\u95ed\u8bbe\u7f6e\u7a97\u53e3\uff0c\u5b57\u4f53\u5927\u5c0f\u4f1a\u7acb\u5373\u751f\u6548\u3002<\/li>\n<\/ul>\n<p><h3>\u56db\u3001\u8c03\u6574\u64cd\u4f5c\u7cfb\u7edf\u7684\u663e\u793a\u8bbe\u7f6e<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u53d1\u73b0\u6240\u6709\u5e94\u7528\u7a0b\u5e8f\u7684\u5b57\u4f53\u90fd\u504f\u5c0f\uff0c\u53ef\u4ee5\u8003\u8651\u8c03\u6574\u64cd\u4f5c\u7cfb\u7edf\u7684\u663e\u793a\u8bbe\u7f6e\uff0c\u8fd9\u6837\u53ef\u4ee5\u6574\u4f53\u8c03\u5927\u6240\u6709\u5e94\u7528\u7a0b\u5e8f\u7684\u5b57\u4f53\u3002<\/p>\n<\/p>\n<p><h4>1\u3001Windows<\/h4>\n<\/p>\n<ul>\n<li>\u53f3\u952e\u70b9\u51fb\u684c\u9762\uff0c\u9009\u62e9\u201cDisplay settings\u201d\u3002<\/li>\n<li>\u5728\u663e\u793a\u8bbe\u7f6e\u4e2d\uff0c\u627e\u5230\u201cScale and layout\u201d\u9009\u9879\uff0c\u8c03\u6574\u7f29\u653e\u6bd4\u4f8b\uff08\u5982125%\u3001150%\uff09\u3002<\/li>\n<li>\u4fdd\u5b58\u8bbe\u7f6e\uff0c\u6240\u6709\u5e94\u7528\u7a0b\u5e8f\u7684\u5b57\u4f53\u5927\u5c0f\u90fd\u4f1a\u751f\u6548\u3002<\/li>\n<\/ul>\n<p><h4>2\u3001macOS<\/h4>\n<\/p>\n<ul>\n<li>\u70b9\u51fb\u5de6\u4e0a\u89d2\u7684\u82f9\u679c\u56fe\u6807\uff0c\u9009\u62e9\u201cSystem Preferences\u201d\u3002<\/li>\n<li>\u5728\u7cfb\u7edf\u504f\u597d\u8bbe\u7f6e\u4e2d\uff0c\u9009\u62e9\u201cDisplays\u201d\u3002<\/li>\n<li>\u5728\u663e\u793a\u8bbe\u7f6e\u4e2d\uff0c\u8c03\u6574\u201cResolution\u201d\u9009\u9879\uff0c\u9009\u62e9\u201cScaled\u201d\u5e76\u9009\u62e9\u4e00\u4e2a\u8f83\u5927\u7684\u5206\u8fa8\u7387\u3002<\/li>\n<li>\u6240\u6709\u5e94\u7528\u7a0b\u5e8f\u7684\u5b57\u4f53\u5927\u5c0f\u90fd\u4f1a\u751f\u6548\u3002<\/li>\n<\/ul>\n<p><h3>\u4e94\u3001\u901a\u8fc7CSS\u6837\u5f0f\u8c03\u6574Jupyter Notebook\u5b57\u4f53<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u5e0c\u671b\u5bf9Jupyter Notebook\u7684\u5916\u89c2\u8fdb\u884c\u66f4\u7cbe\u7ec6\u7684\u63a7\u5236\uff0c\u53ef\u4ee5\u901a\u8fc7CSS\u6837\u5f0f\u6765\u8c03\u6574\u5b57\u4f53\u5927\u5c0f\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u521b\u5efa\u81ea\u5b9a\u4e49CSS\u6587\u4ef6<\/h4>\n<\/p>\n<ul>\n<li>\u5728\u4f60\u7684Jupyter Notebook\u914d\u7f6e\u76ee\u5f55\uff08\u901a\u5e38\u662f<code>~\/.jupyter<\/code>\uff09\u4e2d\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>custom.css<\/code>\u7684\u6587\u4ef6\u3002<\/li>\n<li>\u5728<code>custom.css<\/code>\u6587\u4ef6\u4e2d\uff0c\u6dfb\u52a0\u4ee5\u4e0bCSS\u4ee3\u7801\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-css\">\/* \u8c03\u6574\u4ee3\u7801\u5355\u5143\u683c\u5b57\u4f53\u5927\u5c0f *\/<\/p>\n<p>.CodeMirror pre {<\/p>\n<p>  font-size: 16px;<\/p>\n<p>}<\/p>\n<p>\/* \u8c03\u6574Markdown\u5355\u5143\u683c\u5b57\u4f53\u5927\u5c0f *\/<\/p>\n<p>.rendered_html {<\/p>\n<p>  font-size: 16px;<\/p>\n<p>}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ul>\n<li>\u4fdd\u5b58\u6587\u4ef6\uff0c\u91cd\u542fJupyter Notebook\uff0c\u5b57\u4f53\u5927\u5c0f\u4f1a\u7acb\u5373\u751f\u6548\u3002<\/li>\n<\/ul>\n<p><h4>2\u3001\u4f7f\u7528Jupyter Notebook Extensions<\/h4>\n<\/p>\n<p><p>Jupyter Notebook Extensions\u662f\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684\u63d2\u4ef6\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u81ea\u5b9a\u4e49Jupyter Notebook\u7684\u5916\u89c2\u548c\u529f\u80fd\u3002\u4ee5\u4e0b\u662f\u5b89\u88c5\u548c\u4f7f\u7528\u7684\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5b89\u88c5Jupyter Notebook Extensions\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-bash\">pip install jupyter_contrib_nbextensions<\/p>\n<p>jupyter contrib nbextension install --user<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ul>\n<li>\u542f\u52a8Jupyter Notebook\uff0c\u70b9\u51fb\u9876\u90e8\u83dc\u5355\u680f\u7684\u201cNbextensions\u201d\u3002<\/li>\n<li>\u5728\u6269\u5c55\u7ba1\u7406\u5668\u4e2d\uff0c\u627e\u5230\u201cCode Font Size\u201d\u6269\u5c55\uff0c\u542f\u7528\u5b83\u3002<\/li>\n<li>\u4f60\u53ef\u4ee5\u5728\u6269\u5c55\u8bbe\u7f6e\u4e2d\u8c03\u6574\u4ee3\u7801\u548cMarkdown\u5355\u5143\u683c\u7684\u5b57\u4f53\u5927\u5c0f\u3002<\/li>\n<\/ul>\n<p><h3>\u516d\u3001\u8c03\u6574IPython\u63a7\u5236\u53f0\u5b57\u4f53\u5927\u5c0f<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662fIPython\u63a7\u5236\u53f0\uff0c\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u914d\u7f6e\u6587\u4ef6\u6765\u4fee\u6539\u5b57\u4f53\u5927\u5c0f\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u627e\u5230IPython\u914d\u7f6e\u6587\u4ef6<\/h4>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u751f\u6210IPython\u914d\u7f6e\u6587\u4ef6\uff08\u5982\u679c\u8fd8\u6ca1\u6709\uff09\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-bash\">ipython profile create<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ul>\n<li>\u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u4f4d\u4e8e<code>~\/.ipython\/profile_default\/ipython_config.py<\/code>\u3002<\/li>\n<\/ul>\n<p><h4>2\u3001\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/h4>\n<\/p>\n<ul>\n<li>\u6253\u5f00<code>ipython_config.py<\/code>\u6587\u4ef6\uff0c\u627e\u5230\u6216\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">c.TerminalInteractiveShell.editing_mode = &#39;vi&#39;<\/p>\n<p>c.TerminalInteractiveShell.highlighting_style = &#39;monok<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>&#39;<\/p>\n<p>c.TerminalInteractiveShell.highlighting_style_overrides = {<\/p>\n<p>    Token.Prompt: &#39;#ansiblue bold&#39;,<\/p>\n<p>    Token.PromptNum: &#39;#ansiblue bold&#39;,<\/p>\n<p>    Token.OutPrompt: &#39;#ansired bold&#39;,<\/p>\n<p>    Token.OutPromptNum: &#39;#ansired bold&#39;,<\/p>\n<p>    Token.Text: &#39;ansiblue&#39;<\/p>\n<p>}<\/p>\n<p>c.TerminalInteractiveShell.highlighting_style_overrides.update({<\/p>\n<p>    Token: &#39;#ansiblue&#39;,<\/p>\n<p>    Token.Text: &#39;#ansiblue&#39;<\/p>\n<p>})<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ul>\n<li>\u4fdd\u5b58\u6587\u4ef6\uff0c\u91cd\u542fIPython\u63a7\u5236\u53f0\uff0c\u5b57\u4f53\u5927\u5c0f\u4f1a\u7acb\u5373\u751f\u6548\u3002<\/li>\n<\/ul>\n<p><h3>\u4e03\u3001\u901a\u8fc7\u7f16\u5199\u811a\u672c\u52a8\u6001\u8c03\u6574\u5b57\u4f53\u5927\u5c0f<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u5e0c\u671b\u5728\u8fd0\u884cPython\u811a\u672c\u65f6\u52a8\u6001\u8c03\u6574\u5b57\u4f53\u5927\u5c0f\uff0c\u53ef\u4ee5\u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u6765\u5b9e\u73b0\u8fd9\u4e00\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u521b\u5efa\u4e00\u4e2aPython\u811a\u672c<\/h4>\n<\/p>\n<ul>\n<li>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>adjust_font_size.py<\/code>\u7684\u6587\u4ef6\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>def set_font_size(size):<\/p>\n<p>    plt.rcParams.update({&#39;font.size&#39;: size})<\/p>\n<h2><strong>\u793a\u4f8b\uff1a\u5c06\u5b57\u4f53\u5927\u5c0f\u8bbe\u7f6e\u4e3a16<\/strong><\/h2>\n<p>set_font_size(16)<\/p>\n<h2><strong>\u7ed8\u5236\u793a\u4f8b\u56fe\u8868<\/strong><\/h2>\n<p>plt.plot([1, 2, 3], [4, 5, 6])<\/p>\n<p>plt.title(&#39;Example Plot&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ul>\n<li>\u8fd0\u884c\u811a\u672c\uff0c\u56fe\u8868\u7684\u5b57\u4f53\u5927\u5c0f\u4f1a\u6839\u636e\u8bbe\u7f6e\u7684\u5927\u5c0f\u8fdb\u884c\u8c03\u6574\u3002<\/li>\n<\/ul>\n<p><h4>2\u3001\u5728Jupyter Notebook\u4e2d\u4f7f\u7528<\/h4>\n<\/p>\n<ul>\n<li>\u5728Jupyter Notebook\u5355\u5143\u683c\u4e2d\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>def set_font_size(size):<\/p>\n<p>    plt.rcParams.update({&#39;font.size&#39;: size})<\/p>\n<h2><strong>\u793a\u4f8b\uff1a\u5c06\u5b57\u4f53\u5927\u5c0f\u8bbe\u7f6e\u4e3a16<\/strong><\/h2>\n<p>set_font_size(16)<\/p>\n<h2><strong>\u7ed8\u5236\u793a\u4f8b\u56fe\u8868<\/strong><\/h2>\n<p>plt.plot([1, 2, 3], [4, 5, 6])<\/p>\n<p>plt.title(&#39;Example Plot&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ul>\n<li>\u6267\u884c\u5355\u5143\u683c\uff0c\u56fe\u8868\u7684\u5b57\u4f53\u5927\u5c0f\u4f1a\u6839\u636e\u8bbe\u7f6e\u7684\u5927\u5c0f\u8fdb\u884c\u8c03\u6574\u3002<\/li>\n<\/ul>\n<p><h3>\u516b\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u4f60\u53ef\u4ee5\u5728\u5404\u79cd\u73af\u5883\u4e0b\u8c03\u5927Python\u7684\u5b57\u4f53\uff0c\u4ece\u800c\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u8212\u9002\u5ea6\u3002\u65e0\u8bba\u4f60\u662f\u4f7f\u7528\u4ee3\u7801\u7f16\u8f91\u5668\u3001IDE\u3001\u7ec8\u7aef\u8fd8\u662fJupyter Notebook\uff0c\u90fd\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u8fdb\u884c\u8c03\u6574\u3002\u5e0c\u671b\u8fd9\u4e9b\u65b9\u6cd5\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u8c03\u6574\u5b57\u4f53\u5927\u5c0f\u4ee5\u63d0\u9ad8\u53ef\u8bfb\u6027\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u8c03\u6574\u5b57\u4f53\u5927\u5c0f\u901a\u5e38\u4e0e\u6240\u4f7f\u7528\u7684IDE\u6216\u6587\u672c\u7f16\u8f91\u5668\u6709\u5173\u3002\u5927\u591a\u6570\u73b0\u4ee3IDE\uff08\u5982PyCharm\u3001VS Code\u7b49\uff09\u90fd\u6709\u8bbe\u7f6e\u9009\u9879\uff0c\u53ef\u4ee5\u8ba9\u7528\u6237\u8f7b\u677e\u5730\u4fee\u6539\u4ee3\u7801\u7f16\u8f91\u5668\u7684\u5b57\u4f53\u5927\u5c0f\u3002\u901a\u5e38\u53ef\u4ee5\u5728\u201c\u8bbe\u7f6e\u201d\u6216\u201c\u504f\u597d\u8bbe\u7f6e\u201d\u4e2d\u627e\u5230\u201c\u5b57\u4f53\u201d\u9009\u9879\uff0c\u7528\u6237\u53ef\u4ee5\u9009\u62e9\u9002\u5408\u81ea\u5df1\u9700\u6c42\u7684\u5b57\u4f53\u5927\u5c0f\u3002<\/p>\n<p><strong>\u5728Jupyter Notebook\u4e2d\u5982\u4f55\u6539\u53d8\u5b57\u4f53\u5927\u5c0f\uff1f<\/strong><br \/>\u5728Jupyter Notebook\u4e2d\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u81ea\u5b9a\u4e49CSS\u6765\u6539\u53d8\u5b57\u4f53\u5927\u5c0f\u3002\u53ef\u4ee5\u5728Notebook\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u4ee3\u7801\u4ee5\u6539\u53d8\u6240\u6709\u5355\u5143\u683c\u7684\u5b57\u4f53\u5927\u5c0f\uff1a  <\/p>\n<pre><code class=\"language-html\">%%html\n&lt;style&gt;\n    body {\n        font-size: 16px;  \/* \u4f60\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8c03\u6574\u8fd9\u4e2a\u503c *\/\n    }\n&lt;\/style&gt;\n<\/code><\/pre>\n<p>\u6267\u884c\u540e\uff0cNotebook\u4e2d\u7684\u5b57\u4f53\u5c06\u4f1a\u53d8\u5927\uff0c\u63d0\u5347\u53ef\u8bfb\u6027\u3002<\/p>\n<p><strong>\u4f7f\u7528Python\u5e93\uff08\u5982Matplotlib\uff09\u65f6\u5982\u4f55\u8bbe\u7f6e\u5b57\u4f53\u5927\u5c0f\uff1f<\/strong><br \/>\u5728\u4f7f\u7528Matplotlib\u8fdb\u884c\u6570\u636e\u53ef\u89c6\u5316\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e<code>fontsize<\/code>\u53c2\u6570\u6765\u8c03\u6574\u56fe\u8868\u4e2d\u7684\u5b57\u4f53\u5927\u5c0f\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>plt.xlabel()<\/code>\u548c<code>plt.title()<\/code>\u65f6\uff0c\u53ef\u4ee5\u4f20\u5165<code>fontsize<\/code>\u53c2\u6570\u6765\u63a7\u5236\u5b57\u4f53\u7684\u5927\u5c0f\uff0c\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a  <\/p>\n<pre><code class=\"language-python\">import matplotlib.pyplot as plt\n\nplt.title(&quot;\u8fd9\u662f\u6807\u9898&quot;, fontsize=20)\nplt.xlabel(&quot;X\u8f74&quot;, fontsize=15)\nplt.ylabel(&quot;Y\u8f74&quot;, fontsize=15)\nplt.show()\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u786e\u4fdd\u5728\u751f\u6210\u7684\u56fe\u8868\u4e2d\uff0c\u5b57\u4f53\u5927\u5c0f\u7b26\u5408\u60a8\u7684\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8c03\u5927Python\u5b57\u4f53\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u4ee3\u7801\u7f16\u8f91\u5668\u7684\u8bbe\u7f6e\u3001\u4fee\u6539\u7ec8\u7aef\u5b57\u4f53\u5927\u5c0f\u3001\u4f7f\u7528\u7279\u5b9a\u7684IDE\u6216\u6587\u672c\u7f16\u8f91\u5668\u3001\u8c03\u6574\u64cd\u4f5c\u7cfb\u7edf [&hellip;]","protected":false},"author":3,"featured_media":1180151,"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\/1180143"}],"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=1180143"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1180143\/revisions"}],"predecessor-version":[{"id":1180154,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1180143\/revisions\/1180154"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1180151"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1180143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1180143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1180143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}