{"id":1008,"date":"2021-07-23T15:43:40","date_gmt":"2021-07-23T07:43:40","guid":{"rendered":"https:\/\/xg1990.com\/blog\/?p=1008"},"modified":"2021-07-23T15:50:33","modified_gmt":"2021-07-23T07:50:33","slug":"python%e8%bf%9b%e9%98%b6%e7%ac%94%e8%ae%b0%ef%bc%9a%e4%bb%8e%e5%ae%9e%e9%aa%8c%e5%ae%a4%e5%88%b0%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/xg1990.com\/blog\/archives\/1008","title":{"rendered":"Python\u8fdb\u9636\u7b14\u8bb0\uff1a\u4ece\u5b9e\u9a8c\u5ba4\u5230\u751f\u4ea7\u73af\u5883"},"content":{"rendered":"\n<h1>\u4ece\u7b14\u8bb0\u672c\uff08notebook\uff09\u5230\u547d\u4ee4\u884c<\/h1>\n\n\n\n<p>\u5927\u591a\u6570python\u521d\u5b66\u8005\u90fd\u559c\u6b22\u4f7f\u7528jupyter-notebook\u5199\u4ee3\u7801\u3002Jupyter-notebook\u7684\u5f00\u53d1\u73af\u5883\u975e\u5e38\u53cb\u597d\uff0c\u6240\u89c1\u5373\u6240\u5f97\uff0c\u53ef\u4ee5\u5feb\u901f\u6d4b\u8bd5\u4e00\u4e9b\u77ed\u4ee3\u7801\u8fdb\u884c\u6982\u5ff5\u9a8c\u8bc1\u3002\u4f46\u662f\u5b83\u5b58\u5728\u5f88\u591a\u95ee\u9898\uff1a\u4e0d\u53ef\u6d4b\u8bd5\u3001\u4e0d\u53ef\u6a21\u5757\u5316\u3001\u96be\u4ee5\u590d\u7528\u3001\u96be\u4ee5\u8fdb\u884c\u7248\u672c\u7ba1\u7406\u2026\u2026<\/p>\n\n\n\n<p>\u4e00\u4e2a\u751f\u4ea7\u53ef\u7528\u7684python\u9879\u76ee\u5e94\u5f53\u4ee5\u547d\u4ee4\u884c\u4e3a\u5165\u53e3\uff0c\u901a\u8fc7\u6267\u884c\u811a\u672c\u5b9e\u73b0\u6240\u6709\u8bbe\u8ba1\u529f\u80fd\u3002\u4efb\u4f55\u9700\u8981\u4f20\u9012\u7684\u53c2\u6570\u548c\u9009\u9879\u4e5f\u5e94\u5f53\u4ee5\u6807\u51c6\u7684\u547d\u4ee4\u884c\u4f20\u5165\u7ed9\u7a0b\u5e8f\uff0c\u7136\u540e\u901a\u8fc7python\u7684sys\u5e93\u8bfb\u53d6\u3002\u5b9e\u8df5\u4e2d\u66f4\u591a\u7684\u662f\u4f7f\u7528click\u5e93<a href=\"#_ftn1\">[1]<\/a>\u6765\u5904\u7406\u547d\u4ee4\u884c\u7684\u6570\u636e\u4ea4\u4e92\u3002<\/p>\n\n\n\n<h1>\u4ee3\u7801\u98ce\u683c<\/h1>\n\n\n\n<p>\u4e00\u81f4\u7684\u4ee3\u7801\u98ce\u683c\u5bf9\u4e8e\u4ee3\u7801\u5171\u4eab\u548c\u56e2\u961f\u534f\u4f5c\u81f3\u5173\u91cd\u8981\u3002Python\u5b98\u65b9\u6709PEP8\u6587\u4ef6<a href=\"#_ftn2\">[2]<\/a>\u63d0\u4f9b\u5b8c\u6574\u7684\u4ee3\u7801\u98ce\u683c\u6307\u5357\u3002\u4e00\u822c\u7684\u9879\u76ee\u4e00\u822c\u4f1a\u4f7f\u7528\u4ee5\u4e0b\u4efb\u4e00\u5de5\u5177\u6765\u8fdb\u884c\u4ee3\u7801\u98ce\u683c\u68c0\u67e5\uff1a<\/p>\n\n\n\n<ul><li>Pylint\uff1a<a href=\"https:\/\/github.com\/PyCQA\/pylint\">https:\/\/github.com\/PyCQA\/pylint<\/a><\/li><li>Flake8\uff1a<a href=\"https:\/\/github.com\/pycqa\/flake8\">https:\/\/github.com\/pycqa\/flake8<\/a><\/li><\/ul>\n\n\n\n<p>\u4ee5\u4e0a\u68c0\u67e5\u5de5\u5177\u90fd\u4f1a\u5bf9\u4ee3\u7801\u8fdb\u884c\u6253\u5206\uff0c\u4e00\u4e2a\u4f01\u4e1a\u7ea7\u9ad8\u8d28\u91cfpython\u9879\u76ee\u5e94\u5f53\u529b\u4e89\u5728\u4ee3\u7801\u98ce\u683c\u4e0a\u5b8c\u5168\u9075\u5b88PEP8\u4ee3\u7801\u89c4\u8303<\/p>\n\n\n\n<p>\u6b64\u5916\u4ee5\u4e0a\u4ee3\u7801\u98ce\u683c\u68c0\u67e5\u5de5\u5177\u90fd\u63d0\u4f9b\u4e86\u81ea\u52a8\u683c\u5f0f\u5316\u529f\u80fd\u5e2e\u52a9\u5904\u7406\u5e38\u89c1\u7684\u683c\u5f0f\u95ee\u9898\uff0c\u4f46\u529f\u80fd\u5e76\u4e0d\u5b8c\u5584\uff1b python\u4ee3\u7801\u683c\u5f0f\u5316\u5de5\u5177Black\uff08beta\u516c\u6d4b\u4e2d\uff09\u53ef\u4f5c\u4e3a\u66f4\u597d\u7684\u9009\u62e9\uff1a<\/p>\n\n\n\n<ul><li>Black\uff1a<a href=\"https:\/\/github.com\/psf\/black\">https:\/\/github.com\/psf\/black<\/a><\/li><\/ul>\n\n\n\n<h1>\u663e\u5f0f\u7c7b\u578b\u58f0\u660e<\/h1>\n\n\n\n<p>\u5c3d\u7ba1python\u662f\u4e00\u4e2a\u5f31\u7c7b\u578b\u8bed\u8a00\uff0c\u6211\u4eec\u53ef\u4ee5\u4efb\u610f\u6539\u53d8\u53d8\u91cf\u7684\u7c7b\u578b\u800c\u4e0d\u53d7\u4efb\u4f55\u9650\u5236\u3002\u7136\u800c\uff0c\u8fd9\u79cd\u81ea\u7531\u5ea6\u4f1a\u4e25\u91cd\u635f\u5bb3\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u3002\u4e3a\u4e86\u4fc3\u8fdb\u534f\u4f5c\uff0c\u63d0\u5347\u4ee3\u7801\u53ef\u8bfb\u6027\uff0c\u7f16\u5199\u4ee3\u7801\u65f6\u5e94\u5f53\u5c3d\u53ef\u80fd\u7684\u663e\u5f0f\u58f0\u660e\u6240\u6709\u53d8\u91cf\u7c7b\u578b\u3002Python\u5b98\u65b9\u63d0\u4f9b\u4e86PEP 484 &#8212; Type Hints<a href=\"#_ftn3\">[3]<\/a>\u6765\u89c4\u8303\u4ee3\u7801\u4e2d\u7c7b\u578b\u6807\u8bb0\u7684\u4f7f\u7528\uff0c\u540c\u65f6\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528mypy\u5de5\u5177\u8fdb\u884c\u7c7b\u578b\u68c0\u67e5<\/p>\n\n\n\n<ul><li>Mypy\uff1a<a href=\"http:\/\/mypy-lang.org\/\">http:\/\/mypy-lang.org\/<\/a><\/li><\/ul>\n\n\n\n<h1>\u4ee3\u7801\u6587\u6863<\/h1>\n\n\n\n<p>\u4f01\u4e1a\u7ea7\u73af\u5883\u4e0b\u4e00\u5b9a\u4f1a\u6709\u8bb8\u591a\u53ef\u5728\u9879\u76ee\u95f4\u590d\u7528\u7684\u4ee3\u7801\uff0c\u8fd9\u4e9b\u4ee3\u7801\u9700\u8981\u6709\u8be6\u7ec6\u7684\u4f7f\u7528\u6587\u6863\u624d\u80fd\u591f\u4fdd\u8bc1\u56e2\u961f\u7684\u65e0\u969c\u788d\u4f7f\u7528\uff0cpython\u5b98\u65b9\u63d0\u4f9b\u4e86PEP 257 &#8212; Docstring Conventions<a href=\"#_ftn4\">[4]<\/a>\u4f5c\u4e3a\u4ee3\u7801\u6ce8\u91ca\u7684\u6807\u51c6\u89c4\u8303\uff0c\u540c\u65f6\u6211\u4eec\u4e5f\u53ef\u4ee5\u4f7f\u7528pydocstyle\u5de5\u5177\u8fdb\u884c\u6ce8\u91ca\u89c4\u8303\u5f3a\u5236\u68c0\u67e5\uff1a<\/p>\n\n\n\n<ul><li>pydocstyle\uff1a <a href=\"https:\/\/github.com\/PyCQA\/pydocstyle\">https:\/\/github.com\/PyCQA\/pydocstyle<\/a><\/li><\/ul>\n\n\n\n<p>\u6b64\u5916\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u6587\u6863\u7f16\u8bd1\u5de5\u5177\u6839\u636e\u4ee3\u7801\u4e2d\u7684\u6ce8\u91ca\u81ea\u52a8\u751f\u6210\u6587\u6863\uff0c\u5e38\u7528\u7684\u5de5\u5177\u5305\u62ec\uff1a<\/p>\n\n\n\n<ul><li>Sphinx\uff1a<a href=\"https:\/\/www.sphinx-doc.org\/en\/master\/\">https:\/\/www.sphinx-doc.org\/en\/master\/<\/a><\/li><li>Doxygen\uff1a<a href=\"https:\/\/www.doxygen.nl\/manual\/docblocks.html\">https:\/\/www.doxygen.nl\/manual\/docblocks.html<\/a><\/li><li>Mkdocs\uff1ahttps:\/\/www.mkdocs.org\/getting-started\/<\/li><\/ul>\n\n\n\n<p>Sphinx\u662fpython\u9879\u76ee\u4f7f\u7528\u6700\u4e3a\u5e7f\u6cdb\u7684\u6587\u6863\u7f16\u8bd1\u5de5\u5177\uff0c\u4f46\u4ee5rst\u4e3a\u9996\u9009\u6587\u6863\u7f16\u8f91\u8bed\u8a00\u3002doxygen\u652f\u6301python\u4ee5\u5916\u7684\u5176\u4ed6\u8bed\u8a00\uff0cmkdocs\u5219\u6709\u7740\u6700\u597d\u7684markdown\u652f\u6301\u3002<\/p>\n\n\n\n<p>\u9664\u4e86\u81ea\u52a8\u751f\u6210\u7684\u4ee3\u7801\u6587\u6863\u4ee5\u5916\uff0c\u5bf9\u4e8e\u91cd\u8981\u7684\u51fd\u6570\u548c\u6a21\u5757\uff0c\u9879\u76ee\u6587\u6863\u5e94\u5f53\u63d0\u4f9b\u8db3\u591f\u591a\u7684\u6837\u4f8b\u548c\u6559\u7a0b\u4fdd\u969c\u53ef\u91cd\u7528\u7684\u4ee3\u7801\u771f\u6b63\u53d1\u6325\u4ef7\u503c\u3002<\/p>\n\n\n\n<p>\u6709\u4e9b\u4f01\u4e1a\u4f1a\u6709\u4e13\u95e8\u7684\u6587\u6863\u5e93\uff08\u4f8b\u5982confluence\uff09\u5b58\u653e\u6240\u6709\u9879\u76ee\u6587\u6863\u3002\u5c3d\u7ba1\u5982\u6b64\uff0c\u4ee3\u7801\u6587\u6863\u4f9d\u65e7\u4e0d\u53ef\u7f3a\u5c11\uff0c\u5b83\u5e94\u5f53\u8ddf\u968f\u4ee3\u7801\u4e00\u8d77\u4fdd\u5b58\u548c\u66f4\u65b0\u3002<\/p>\n\n\n\n<p>\u4e00\u4e2a\u4f01\u4e1a\u7ea7\u9ad8\u8d28\u91cfpython\u9879\u76ee\u5e94\u5f53\u786e\u4fdd\u5b8c\u6574\u7684\u6587\u6863\uff0c\u5426\u5219\u4efb\u4f55\u5458\u5de5\u7684\u79bb\u804c\u90fd\u662f\u4e00\u573a\u707e\u96be\u3002\u8ba4\u771f\u51c6\u5907\u6587\u6863\u662f\u5bf9\u540c\u4e8b\u548c\u516c\u53f8\u8d1f\u8d23\u4efb\u7684\u8868\u73b0\u3002<\/p>\n\n\n\n<h1>\u6d4b\u8bd5\u9a71\u52a8<\/h1>\n\n\n\n<p>\u4efb\u4f55\u8f6f\u4ef6\u9879\u76ee\u8fdb\u5165\u751f\u4ea7\u73af\u5883\u524d\u90fd\u9700\u8981\u8db3\u591f\u591a\u7684\u6d4b\u8bd5\uff0cpython\u4e5f\u4e0d\u4f8b\u5916\u3002\u4e00\u4e2a\u53ef\u7ef4\u62a4\u7684python\u9879\u76ee\u5e94\u5f53\u5305\u542b\u5c3d\u53ef\u80fd\u591a\u7684\u6d4b\u8bd5\uff08\u5982\u5355\u5143\u6d4b\u8bd5\u3001\u96c6\u6210\u6d4b\u8bd5\u3001\u56de\u5f52\u6d4b\u8bd5\u7b49\uff09\uff0c\u5e38\u7528\u7684\u6d4b\u8bd5\u5de5\u5177\u5305\u62ec\uff1a<\/p>\n\n\n\n<ul><li>Pytest\uff1a<a href=\"https:\/\/docs.pytest.org\">https:\/\/docs.pytest.org<\/a><\/li><li>Unittest\uff1a<a href=\"https:\/\/docs.python.org\/3\/library\/unittest.html\">https:\/\/docs.python.org\/3\/library\/unittest.html<\/a><\/li><\/ul>\n\n\n\n<p>\u540c\u65f6\u6211\u4eec\u9700\u8981\u5173\u6ce8\u6d4b\u8bd5\u8986\u76d6\u7387\uff0c\u4f7f\u7528pytest-cov<a href=\"#_ftn5\">[5]<\/a>\u7b49\u5de5\u5177\u68c0\u67e5\u6d4b\u8bd5\u6848\u4f8b\u662f\u5426\u8986\u76d6\u4e86\u6240\u6709\u7684\u4ee3\u7801\uff0c100%\u6d4b\u8bd5\u8986\u76d6\u7387\u53ea\u80fd\u4f5c\u4e3a\u6d4b\u8bd5\u7684\u6700\u4f4e\u6807\u51c6\uff0c\u4f01\u4e1a\u7ea7\u9ad8\u8d28\u91cf\u4ee3\u7801\u9700\u8981\u786e\u4fdd\u4efb\u4f55\u4ee3\u7801\u901a\u8fc7\u4e86\u6240\u6709\u6781\u7aef\u6848\u4f8b\u7684\u6d4b\u8bd5\u3002<\/p>\n\n\n\n<p>\u5bf9\u4e8e\u5f00\u53d1\u4eba\u5458\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u6d4b\u8bd5\u9a71\u52a8\u5f00\u53d1TDD\uff08Test Driven Development\uff09\u6a21\u5f0f\u5de5\u4f5c\uff0c\u4e0d\u4ec5\u80fd\u591f\u63d0\u5347\u8c03\u8bd5\uff08debug\uff09\u6548\u7387\uff0c\u540c\u65f6\u80fd\u591f\u4ece\u4e00\u5f00\u59cb\u5c31\u601d\u8003\u5982\u4f55\u8ba9\u4ee3\u7801\u6a21\u5757\u5316\u4ee5\u4fbf\u8bbe\u8ba1\u5355\u5143\u6d4b\u8bd5\u3002<\/p>\n\n\n\n<h1>\u865a\u62df\u73af\u5883<\/h1>\n\n\n\n<p>\u4e00\u4e2apython\u9879\u76ee\u5f80\u5f80\u4f1a\u4f9d\u8d56\u8bb8\u591a\u4e0d\u540c\u7684\u5e93\uff0c\u8fd9\u4e9b\u4f9d\u8d56\u5e93\u7684\u7248\u672c\u81f3\u5173\u91cd\u8981\u3002\u4e00\u65e6\u4f7f\u7528\u4e86\u4e0d\u517c\u5bb9\u7684\u7248\u672c\u5c31\u4f1a\u5bfc\u81f4\u6574\u4e2a\u7a0b\u5e8f\u7684\u5d29\u6e83\uff0c\u4e00\u81f4\u7684\u4f9d\u8d56\u5e93\u7248\u672c\u7ba1\u7406\u4e00\u76f4\u662fpython\u8c03\u8bd5\u90e8\u7f72\u7684\u4e00\u5927\u75db\u70b9\u3002<\/p>\n\n\n\n<p>\u4f20\u7edf\u7684\u89e3\u51b3\u65b9\u6848\u662f\u4f7f\u7528venv<a href=\"#_ftn6\">[6]<\/a>, conda<a href=\"#_ftn7\">[7]<\/a>, pipenv<a href=\"#_ftn8\">[8]<\/a>, poetry<a href=\"#_ftn9\">[9]<\/a>\uff0cpyenv<a href=\"#_ftn10\">[10]<\/a>\u7b49\u5de5\u5177\u8fdb\u884c\u4e0d\u540c\u7248\u672c\u7684python\u865a\u62df\u73af\u5883\u7ba1\u7406\u3002\u4f46\u662f\u8fd9\u4e9b\u5de5\u5177\u90fd\u662f\u901a\u8fc7\u4fee\u6539\u73af\u5883\u53d8\u91cf\u5b9e\u73b0\u5728\u540c\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u73af\u5883\u5207\u6362\uff0c\u65e0\u6cd5\u505a\u5230\u7edd\u5bf9\u7684\u9694\u79bb\uff0c\u5f80\u5f80\u4f1a\u9020\u6210\u610f\u6599\u4e4b\u5916\u7684\u9519\u8bef\u548c\u989d\u5916\u7684\u7ef4\u62a4\u6210\u672c\u3002\u7279\u522b\u662f\u4e00\u4e9b\u9700\u8981\u94fe\u63a5\u5e93\u7684python\u5305\uff08\u5982lightgbm\uff09\u5f88\u96be\u7b80\u5355\u7684\u901a\u8fc7pip\u5b89\u88c5\u6210\u529f\u3002<\/p>\n\n\n\n<p>\u5b9e\u8df5\u4e0b\u6765\uff0c\u6700\u4f18\u7684python\u865a\u62df\u73af\u5883\u89e3\u51b3\u65b9\u6848\u8fd8\u662fDocker\uff0c\u901a\u8fc7Dockerfile\u5b9a\u4e49\u5b8c\u5168\u5e72\u51c0\u9694\u79bb\u7684\u865a\u62df\u73af\u5883\uff0c\u540c\u65f6\u80fd\u591f\u5f88\u597d\u7684\u89e3\u51b3\u76f8\u5173\u4e8c\u8fdb\u5236\u94fe\u63a5\u5e93\u7684\u4f9d\u8d56\uff0c\u5e76\u968f\u65f6\u53ef\u4ee5\u6253\u5305\u90e8\u7f72\u5230\u751f\u4ea7\u73af\u5883\u3002<\/p>\n\n\n\n<p>\u6b64\u5916docker\u4e5f\u53ef\u4ee5\u5f88\u65b9\u4fbf\u7684\u542f\u52a8\u7a0b\u5e8f\u4f9d\u8d56\u7684\u5176\u4ed6\u670d\u52a1\uff08\u5982\u6570\u636e\u5e93\u3001\u5185\u5b58\u7f13\u5b58\u3001\u6d88\u606f\u961f\u5217\u3001\u5176\u4ed6\u4f9d\u8d56API\uff09\uff0c\u5b9e\u73b0\u5feb\u901f\u7684\u96c6\u6210\u6d4b\u8bd5\u3002<\/p>\n\n\n\n<h1>\u8c03\u8bd5\u4e0e\u5f02\u5e38\u5904\u7406<\/h1>\n\n\n\n<p>\u5f53python\u4ee3\u7801\u51fa\u73b0\u95ee\u9898\u65f6\uff0c\u6700\u76f4\u63a5\u7684\u6d4b\u8bd5\u65b9\u6848\u5c31\u662f\u4f7f\u7528print\u628a\u6240\u6709\u76f8\u5173\u7684\u53d8\u91cf\u5185\u5bb9\u6253\u5370\u51fa\u6765\uff0c\u5b83\u5f88\u9002\u5408\u5904\u7406\u4e00\u4e9b\u7b80\u5355\u7684\u95ee\u9898\uff0c\u4f46\u5176\u5b9e\u662f\u4e00\u4ef6\u975e\u5e38\u4f4e\u6548\u7684\u8c03\u8bd5\u624b\u6bb5\u3002\u66f4\u52a0\u4e13\u4e1a\u7684\u505a\u6cd5\u5e94\u5f53\u662f\u4f7f\u7528pdb\u5de5\u5177<a href=\"#_ftn11\">[11]<\/a>\u8bca\u65ad\u9519\u8bef\u6808\u3002<\/p>\n\n\n\n<p>\u6b64\u5916\u7531\u4e8epython\u7684\u7075\u6d3b\u6027\uff0c\u5f88\u591a\u51fd\u6570\u6267\u884c\u5230\u6700\u540e\u4e00\u523b\u624d\u663e\u73b0\u9519\u8bef\uff0c\u8fd9\u4f1a\u803d\u8bef\u5f88\u591a\u4e0d\u5fc5\u8981\u7684\u65f6\u95f4\u3002\u56e0\u6b64\u5728\u64b0\u5199\u4ee3\u7801\u65f6\uff0c\u5e94\u5f53\u5c3d\u65e9\u8fdb\u884c\u53c2\u6570\u68c0\u67e5\uff0c\u4f8b\u5982\u5728\u51fd\u6570\u6267\u884c\u7b2c\u4e00\u6b65\u5c31\u8fdb\u884c\u53c2\u6570\u68c0\u67e5\uff0c\u4f8b\u5982\u957f\u5ea6\u662f\u5426\u4e00\u81f4\u3001\u53c2\u6570\u662f\u5426\u6709\u6548\u3001\u662f\u5426\u5305\u542b\u5fc5\u8981\u7684\u5c5e\u6027\u2026\u2026\u8fd9\u4e9b\u90fd\u662flint\u5de5\u5177\u65e0\u6cd5\u68c0\u67e5\u51fa\u6765\u7684\u95ee\u9898\uff0c\u5e94\u5f53\u7531\u5f00\u53d1\u8005\u6839\u636e\u7a0b\u5e8f\u529f\u80fd\u64b0\u5199\u89c4\u5219\u3002<\/p>\n\n\n\n<p>\u6240\u6709\u8fd0\u884c\u65f6\u68c0\u67e5\u51fa\u6765\u7684\u9519\u8bef\u5e94\u5f53\u6839\u636epython\u7684\u5f02\u5e38\u673a\u5236<a href=\"#_ftn12\">[12]<\/a>\u629b\u51fa\u5bf9\u5e94\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u540c\u65f6\u5e94\u5f53\u786e\u4fdd\u9519\u8bef\u539f\u56e0\u8db3\u591f\u8be6\u7ec6\u5230\u5176\u4ed6\u5f00\u53d1\u4eba\u5458\u80fd\u591f\u636e\u6b64\u8fdb\u884c\u8c03\u8bd5\u3002<\/p>\n\n\n\n<h1>\u65e5\u5fd7<\/h1>\n\n\n\n<p>\u6b64\u5916\uff0c\u7a0b\u5e8f\u4e2d\u7684print\u51fd\u6570\u4f1a\u5e26\u6765\u5927\u91cf\u7684\u5c4f\u5e55\u8f93\u51fa\uff0c\u4e0d\u4ec5\u4f1a\u8ba9\u91cd\u8981\u4fe1\u606f\u88ab\u6df9\u6ca1\uff0c\u4e5f\u6781\u5927\u5f71\u54cd\u7a0b\u5e8f\u8fd0\u884c\u6548\u7387\uff08print\u6267\u884c\u7684IO\u5f00\u9500\u5f88\u5927\uff09\u3002<\/p>\n\n\n\n<p>\u66f4\u597d\u7684\u89e3\u51b3\u65b9\u6848\u662f\u4f7f\u7528logging\u5e93<a href=\"#_ftn13\">[13]<\/a>\u8bb0\u5f55\u7a0b\u5e8f\u8fd0\u884c\u65e5\u5fd7\uff0c\u5b83\u4e0eprint\u51fd\u6570\u76f8\u6bd4\u80fd\u591f\u8bb0\u5f55\u4fe1\u606f\u7684\u53d1\u751f\u65f6\u95f4\u3001\u4e25\u91cd\u7a0b\u5ea6\u3001\u8d77\u6e90\u51fd\u6570\uff0c\u540c\u65f6\u652f\u6301\u5f02\u6b65\u8c03\u7528\u907f\u514d\u7a0b\u5e8f\u963b\u585e\uff0c\u5e76\u80fd\u591f\u8f93\u51fa\u5230\u6587\u4ef6\u3001\u5c4f\u5e55\u7b49\u591a\u4e2a\u4f4d\u7f6e\uff0c\u662f\u751f\u4ea7\u73af\u5883\u4e0b\u7684\u5fc5\u5907\u529f\u80fd\u3002<\/p>\n\n\n\n<p>\u5927\u90e8\u5206\u7684python\u5e93\u90fd\u7528\u5230\u4e86logging\u8bb0\u5f55\u6267\u884c\u65e5\u5fd7\uff0c\u4f7f\u7528logging\u4e4b\u540e\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u5168\u5c40\u65e5\u5fd7\u8f93\u51fa\u7b49\u7ea7\uff08\u4f8b\u5982\u8c03\u6574\u5230DEBUG\u7ea7\u522b\uff09\uff0c\u5c31\u53ef\u4ee5\u770b\u5230\u6240\u6709\u4e09\u65b9\u5e93\u7684\u6267\u884c\u65e5\u5fd7\uff0c\u80fd\u591f\u5f88\u65b9\u4fbf\u7684\u8bca\u65ad\u95ee\u9898\u3002<\/p>\n\n\n\n<h1>\u7b80\u6d01\u67b6\u6784<\/h1>\n\n\n\n<p>\u4e00\u65e6python\u9879\u76ee\u8d85\u8fc7\u4e00\u4e2a\u6587\u4ef6\uff0c\u6211\u4eec\u5c31\u9700\u8981\u5f00\u59cb\u601d\u8003\u67b6\u6784\u95ee\u9898\u4e86\uff1a\u5982\u4f55\u8bbe\u8ba1\u7c7b\u4e0e\u63a5\u53e3\uff0c\u5982\u4f55\u7ec4\u7ec7\u51fd\u6570\u4e0e\u6a21\u5757\uff0c\u5982\u4f55\u63d0\u5347\u5e94\u7528\u7684\u53ef\u6269\u5c55\u6027\u2026\u2026\u8fd9\u4e9b\u95ee\u9898\u4e0d\u518d\u662fpython\u7684\u8bed\u6cd5\u95ee\u9898\uff0c\u800c\u9700\u8981\u5bf9\u8f6f\u4ef6\u67b6\u6784\u8bbe\u8ba1\u6709\u6df1\u5165\u7684\u7406\u89e3\u548c\u7ecf\u9a8c\u3002\u4f8b\u5982\u6211\u4eec\u53ef\u4ee5\u53c2\u8003\u6700\u4e3a\u6d41\u884c\u7684\u67b6\u6784\u8bbe\u8ba1SOLID\u539f\u5219\uff1a<\/p>\n\n\n\n<ul><li>SRP\u5355\u4e00\u804c\u8d23\u539f\u5219\uff1a\u6bcf\u4e00\u4e2a\u6a21\u5757\u5e94\u8be5\u53ea\u8d1f\u8d23\u4e00\u7c7b\u884c\u4e3a\u6216\u8005\u804c\u8d23\uff0c\u907f\u514d\u8fc7\u5ea6\u8026\u5408<\/li><li>OCP\u5f00\u95ed\u539f\u5219\uff1a\u65b0\u589e\u529f\u80fd\u65f6\u5e94\u5f53\u6700\u5c0f\u5316\u4fee\u6539\u539f\u6709\u4ee3\u7801\uff0c\u5b9e\u73b0\u63d2\u4ef6\u5f0f\u6269\u5c55<\/li><li>LSP\u91cc\u6c0f\u66ff\u6362\u539f\u5219\uff1a\u7c7b\u7684\u7ee7\u627f\u9700\u8981\u786e\u4fdd\u5b50\u7c7b\u80fd\u591f\u6b63\u5e38\u5b9e\u73b0\u57fa\u7c7b\u6240\u6709\u63a5\u53e3\uff0c\u5426\u5219\u5c31\u4e0d\u5e94\u5f53\u7ee7\u627f\uff0c\u6216\u8005\u91cd\u65b0\u8bbe\u8ba1\u57fa\u7c7b<\/li><li>ISP\u63a5\u53e3\u9694\u79bb\u539f\u5219\uff1a\u4efb\u4f55\u6a21\u5757\u90fd\u4e0d\u8981\u4f9d\u8d56\u5b83\u4e0d\u9700\u8981\u7684\u6a21\u5757\u529f\u80fd\uff0c\u5e26\u6765\u4e0d\u5fc5\u8981\u7684\u8fd0\u7ef4\u590d\u6742\u5ea6<\/li><li>DIP \u4f9d\u8d56\u53cd\u8f6c\u9009\u62e9\uff1a\u4ee3\u7801\u4e2d\u62bd\u8c61\u63a5\u53e3\u548c\u5177\u4f53\u5b9e\u73b0\u4e4b\u95f4\u9700\u8981\u660e\u786e\u8fb9\u754c\uff0c\u62bd\u8c61\u63a5\u53e3\u88ab\u7cbe\u5fc3\u8bbe\u8ba1\u7a33\u5b9a\u4e0d\u53d8\uff0c\u5177\u4f53\u5b9e\u73b0\u53ea\u4f9d\u8d56\u548c\u8c03\u7528\u62bd\u8c61\u63a5\u53e3\uff0c\u4fdd\u8bc1\u4ee3\u7801\u4f9d\u8d56\u548c\u63a7\u5236\u6d41\u53cd\u5411<\/li><\/ul>\n\n\n\n<h1>\u53d1\u5e03\u4e0e\u7248\u672c\u7ba1\u7406<\/h1>\n\n\n\n<p>\u4e00\u4e2apython\u9879\u76ee\u5b8c\u6210\u540e\uff0c\u5e94\u5f53\u4ea4\u4ed8\u4ec0\u4e48\uff1f\u7b80\u5355\u628a\u6240\u6709\u4ee3\u7801\u653e\u8fdb\u4e00\u4e2a\u538b\u7f29\u5305\u662f\u8fdc\u4e0d\u591f\u7684\u3002<\/p>\n\n\n\n<p>Python\u9879\u76ee\u5e94\u5f53\u88ab\u5c01\u88c5\u8fdb\u4e00\u4e2atar\u6216\u8005whl\u6587\u4ef6\u4e2d\uff0c\u80fd\u591f\u76f4\u63a5\u88ab\u5176\u4ed6\u4eba\u901a\u8fc7pip\u5b89\u88c5\u3002python\u5b98\u65b9\u4e5f\u63d0\u4f9b\u4e86\u6587\u6863\u8bb2\u89e3\u5982\u4f55\u6253\u5305python\u9879\u76ee<a href=\"#_ftn14\">[14]<\/a>\u3002<\/p>\n\n\n\n<p>\u89c4\u8303\u6253\u5305\u7684\u4ee3\u7801\u4f1a\u6709\u5bf9\u5e94\u7684\u7248\u672c\u53f7\uff0c\u65b9\u4fbf\u4f7f\u7528\u8005\u9009\u62e9\u9700\u8981\u7684\u7248\u672c\uff1b\u4f1a\u6709\u4f9d\u8d56\u5e93\u7248\u672c\u63cf\u8ff0\uff0c\u80fd\u8ba9pip\u5b89\u88c5\u65f6\u81ea\u52a8\u89e3\u6790\u4f9d\u8d56\u5173\u7cfb\u3002<\/p>\n\n\n\n<h1>\u811a\u624b\u67b6 \/ Scaffold<\/h1>\n\n\n\n<p>\u5728\u4e00\u4e2a\u4ece\u96f6\u5f00\u59cb\u7684python\u9879\u76ee\u4e2d\u6784\u5efa\u4ee5\u4e0a\u5185\u5bb9\u4f1a\u975e\u5e38\u7e41\u7410\uff0c\u5e38\u7528\u7684\u89e3\u51b3\u65b9\u6848\u662f\u4f7f\u7528\u811a\u624b\u67b6\uff08scaffold\uff09\u81ea\u52a8\u751f\u6210\u4e00\u4e2a\u9879\u76ee\u6a21\u7248\uff0c\u4f8b\u5982<\/p>\n\n\n\n<ul><li>PyScaffold: <a href=\"https:\/\/pyscaffold.org\/\">https:\/\/pyscaffold.org\/<\/a><\/li><\/ul>\n\n\n\n<p>\u4f46\u8fd9\u4e9b\u811a\u624b\u67b6\u5e76\u4e0d\u80fd\u5b8c\u5168\u5305\u542b\u4ee5\u4e0a\u6240\u6709\u5185\u5bb9\uff0c\u5f80\u5f80\u518d\u9700\u8981\u8fdb\u884c\u989d\u5916\u7684\u4fee\u8ba2\u3002\u6bcf\u4e00\u4e2a\u4f01\u4e1a\u6216\u8005\u9879\u76ee\u7ec4\u90fd\u6709\u5fc5\u8981\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\uff0c\u5b9a\u5236\u5e76\u5171\u4eab\u5c5e\u4e8e\u81ea\u5df1\u7684\u811a\u624b\u67b6<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><a href=\"#_ftnref1\">[1]<\/a> <a href=\"https:\/\/click.palletsprojects.com\/en\/8.0.x\/\">https:\/\/click.palletsprojects.com\/en\/8.0.x\/<\/a><\/p>\n\n\n\n<p><a href=\"#_ftnref2\">[2]<\/a> <a href=\"https:\/\/www.python.org\/dev\/peps\/pep-0008\/\">https:\/\/www.python.org\/dev\/peps\/pep-0008\/<\/a><\/p>\n\n\n\n<p><a href=\"#_ftnref3\">[3]<\/a> <a href=\"https:\/\/www.python.org\/dev\/peps\/pep-0484\/\">https:\/\/www.python.org\/dev\/peps\/pep-0484\/<\/a><\/p>\n\n\n\n<p><a href=\"#_ftnref4\">[4]<\/a> <a href=\"https:\/\/www.python.org\/dev\/peps\/pep-0257\/\">https:\/\/www.python.org\/dev\/peps\/pep-0257\/<\/a><\/p>\n\n\n\n<p><a href=\"#_ftnref5\">[5]<\/a> <a href=\"https:\/\/pytest-cov.readthedocs.io\/en\/latest\/\">https:\/\/pytest-cov.readthedocs.io\/en\/latest\/<\/a><\/p>\n\n\n\n<p><a href=\"#_ftnref6\">[6]<\/a> <a href=\"https:\/\/docs.python.org\/3\/library\/venv.html\">https:\/\/docs.python.org\/3\/library\/venv.html<\/a><\/p>\n\n\n\n<p><a href=\"#_ftnref7\">[7]<\/a> <a href=\"https:\/\/conda.io\/projects\/conda\/en\/latest\/user-guide\/tasks\/manage-environments.html\">https:\/\/conda.io\/projects\/conda\/en\/latest\/user-guide\/tasks\/manage-environments.html<\/a><\/p>\n\n\n\n<p><a href=\"#_ftnref8\">[8]<\/a> <a href=\"https:\/\/pipenv.pypa.io\/en\/latest\/\">https:\/\/pipenv.pypa.io\/en\/latest\/<\/a><\/p>\n\n\n\n<p><a href=\"#_ftnref9\">[9]<\/a> <a href=\"https:\/\/python-poetry.org\/docs\/managing-environments\/\">https:\/\/python-poetry.org\/docs\/managing-environments\/<\/a><\/p>\n\n\n\n<p><a href=\"#_ftnref10\">[10]<\/a> <a href=\"https:\/\/github.com\/pyenv\/pyenv\">https:\/\/github.com\/pyenv\/pyenv<\/a><\/p>\n\n\n\n<p><a href=\"#_ftnref11\">[11]<\/a> <a href=\"https:\/\/docs.python.org\/3\/library\/pdb.html\">https:\/\/docs.python.org\/3\/library\/pdb.html<\/a><\/p>\n\n\n\n<p><a href=\"#_ftnref12\">[12]<\/a> <a href=\"https:\/\/docs.python.org\/3\/tutorial\/errors.html\">https:\/\/docs.python.org\/3\/tutorial\/errors.html<\/a><\/p>\n\n\n\n<p><a href=\"#_ftnref13\">[13]<\/a> <a href=\"https:\/\/docs.python.org\/3\/library\/logging.html\">https:\/\/docs.python.org\/3\/library\/logging.html<\/a><\/p>\n\n\n\n<p><a href=\"#_ftnref14\">[14]<\/a> <a href=\"https:\/\/packaging.python.org\/tutorials\/packaging-projects\/\">https:\/\/packaging.python.org\/tutorials\/packaging-projects\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ece\u7b14\u8bb0\u672c\uff08notebook\uff09\u5230\u547d\u4ee4\u884c \u5927\u591a\u6570python\u521d\u5b66\u8005\u90fd\u559c\u6b22\u4f7f\u7528jupyter-notebook\u5199\u4ee3\u7801&hellip;&nbsp;<a href=\"https:\/\/xg1990.com\/blog\/archives\/1008\" class=\"\" rel=\"bookmark\">\u9605\u8bfb\u66f4\u591a &raquo;<span class=\"screen-reader-text\">Python\u8fdb\u9636\u7b14\u8bb0\uff1a\u4ece\u5b9e\u9a8c\u5ba4\u5230\u751f\u4ea7\u73af\u5883<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"categories":[1],"tags":[],"translation":{"provider":"WPGlobus","version":"3.0.1","language":"zh","enabled_languages":["zh","en"],"languages":{"zh":{"title":true,"content":true,"excerpt":false},"en":{"title":false,"content":false,"excerpt":false}}},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.4.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python\u8fdb\u9636\u7b14\u8bb0\uff1a\u4ece\u5b9e\u9a8c\u5ba4\u5230\u751f\u4ea7\u73af\u5883 - xg1990<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/xg1990.com\/blog\/archives\/1008\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python\u8fdb\u9636\u7b14\u8bb0\uff1a\u4ece\u5b9e\u9a8c\u5ba4\u5230\u751f\u4ea7\u73af\u5883 - xg1990\" \/>\n<meta property=\"og:url\" content=\"https:\/\/xg1990.com\/blog\/archives\/1008\" \/>\n<meta property=\"og:site_name\" content=\"xg1990\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-23T07:43:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-23T07:50:33+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"xg1990\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/xg1990.com\/blog\/#website\",\"url\":\"https:\/\/xg1990.com\/blog\/\",\"name\":\"xg1990\",\"description\":\"\u5730\u7406\u5708\u7684\u7801\u519c\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/xg1990.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-CN\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/xg1990.com\/blog\/archives\/1008#webpage\",\"url\":\"https:\/\/xg1990.com\/blog\/archives\/1008\",\"name\":\"Python\u8fdb\u9636\u7b14\u8bb0\uff1a\u4ece\u5b9e\u9a8c\u5ba4\u5230\u751f\u4ea7\u73af\u5883 - xg1990\",\"isPartOf\":{\"@id\":\"https:\/\/xg1990.com\/blog\/#website\"},\"datePublished\":\"2021-07-23T07:43:40+00:00\",\"dateModified\":\"2021-07-23T07:50:33+00:00\",\"author\":{\"@id\":\"https:\/\/xg1990.com\/blog\/#\/schema\/person\/774c05a86b0a61bb8ff633749c59fa8f\"},\"breadcrumb\":{\"@id\":\"https:\/\/xg1990.com\/blog\/archives\/1008#breadcrumb\"},\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/xg1990.com\/blog\/archives\/1008\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/xg1990.com\/blog\/archives\/1008#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/xg1990.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\u8fdb\u9636\u7b14\u8bb0\uff1a\u4ece\u5b9e\u9a8c\u5ba4\u5230\u751f\u4ea7\u73af\u5883\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/xg1990.com\/blog\/#\/schema\/person\/774c05a86b0a61bb8ff633749c59fa8f\",\"name\":\"xg1990\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/xg1990.com\/blog\/#personlogo\",\"inLanguage\":\"zh-CN\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2d326d725f277a38a498575f23200141?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2d326d725f277a38a498575f23200141?s=96&d=mm&r=g\",\"caption\":\"xg1990\"},\"url\":\"https:\/\/xg1990.com\/blog\/archives\/author\/xg1990\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python\u8fdb\u9636\u7b14\u8bb0\uff1a\u4ece\u5b9e\u9a8c\u5ba4\u5230\u751f\u4ea7\u73af\u5883 - xg1990","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/xg1990.com\/blog\/archives\/1008","og_locale":"zh_CN","og_type":"article","og_title":"Python\u8fdb\u9636\u7b14\u8bb0\uff1a\u4ece\u5b9e\u9a8c\u5ba4\u5230\u751f\u4ea7\u73af\u5883 - xg1990","og_url":"https:\/\/xg1990.com\/blog\/archives\/1008","og_site_name":"xg1990","article_published_time":"2021-07-23T07:43:40+00:00","article_modified_time":"2021-07-23T07:50:33+00:00","twitter_misc":{"\u4f5c\u8005":"xg1990","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/xg1990.com\/blog\/#website","url":"https:\/\/xg1990.com\/blog\/","name":"xg1990","description":"\u5730\u7406\u5708\u7684\u7801\u519c","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/xg1990.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-CN"},{"@type":"WebPage","@id":"https:\/\/xg1990.com\/blog\/archives\/1008#webpage","url":"https:\/\/xg1990.com\/blog\/archives\/1008","name":"Python\u8fdb\u9636\u7b14\u8bb0\uff1a\u4ece\u5b9e\u9a8c\u5ba4\u5230\u751f\u4ea7\u73af\u5883 - xg1990","isPartOf":{"@id":"https:\/\/xg1990.com\/blog\/#website"},"datePublished":"2021-07-23T07:43:40+00:00","dateModified":"2021-07-23T07:50:33+00:00","author":{"@id":"https:\/\/xg1990.com\/blog\/#\/schema\/person\/774c05a86b0a61bb8ff633749c59fa8f"},"breadcrumb":{"@id":"https:\/\/xg1990.com\/blog\/archives\/1008#breadcrumb"},"inLanguage":"zh-CN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/xg1990.com\/blog\/archives\/1008"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/xg1990.com\/blog\/archives\/1008#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/xg1990.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Python\u8fdb\u9636\u7b14\u8bb0\uff1a\u4ece\u5b9e\u9a8c\u5ba4\u5230\u751f\u4ea7\u73af\u5883"}]},{"@type":"Person","@id":"https:\/\/xg1990.com\/blog\/#\/schema\/person\/774c05a86b0a61bb8ff633749c59fa8f","name":"xg1990","image":{"@type":"ImageObject","@id":"https:\/\/xg1990.com\/blog\/#personlogo","inLanguage":"zh-CN","url":"https:\/\/secure.gravatar.com\/avatar\/2d326d725f277a38a498575f23200141?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2d326d725f277a38a498575f23200141?s=96&d=mm&r=g","caption":"xg1990"},"url":"https:\/\/xg1990.com\/blog\/archives\/author\/xg1990"}]}},"_links":{"self":[{"href":"https:\/\/xg1990.com\/blog\/wp-json\/wp\/v2\/posts\/1008"}],"collection":[{"href":"https:\/\/xg1990.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xg1990.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xg1990.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xg1990.com\/blog\/wp-json\/wp\/v2\/comments?post=1008"}],"version-history":[{"count":2,"href":"https:\/\/xg1990.com\/blog\/wp-json\/wp\/v2\/posts\/1008\/revisions"}],"predecessor-version":[{"id":1010,"href":"https:\/\/xg1990.com\/blog\/wp-json\/wp\/v2\/posts\/1008\/revisions\/1010"}],"wp:attachment":[{"href":"https:\/\/xg1990.com\/blog\/wp-json\/wp\/v2\/media?parent=1008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xg1990.com\/blog\/wp-json\/wp\/v2\/categories?post=1008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xg1990.com\/blog\/wp-json\/wp\/v2\/tags?post=1008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}