{"id":8041,"date":"2026-08-24T17:34:27","date_gmt":"2026-08-24T09:34:27","guid":{"rendered":"https:\/\/www.xinyixx.com\/?p=8041"},"modified":"2026-08-24T17:34:27","modified_gmt":"2026-08-24T09:34:27","slug":"olympiadmath","status":"publish","type":"post","link":"https:\/\/www.xinyixx.com\/index.php\/2026\/08\/24\/olympiadmath\/","title":{"rendered":"Tkinter \u91cc\u600e\u4e48\u628a LaTeX \u516c\u5f0f\u548c\u4e2d\u6587\u6392\u5728\u540c\u4e00\u884c\u2014\u2014\u5965\u8d5b\u9898\u5e93 OlympiadMath"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u672c\u7cfb\u5217<\/strong>\uff1a\u628a\u8fd9\u4e24\u5e74\u7528 Python \u5199\u7684\u5341\u51e0\u4e2a\u5c0f\u9879\u76ee\u6328\u4e2a\u5f00\u6e90\u3001\u6328\u4e2a\u8bf4\u6e05\u695a\u3002\u4e0d\u8bb2&#8221;\u6211\u505a\u4e86\u4ec0\u4e48&#8221;\uff0c\u8bb2&#8221;\u505a\u7684\u8fc7\u7a0b\u4e2d\u88ab\u4ec0\u4e48\u6253\u8138\u3001\u6700\u540e\u600e\u4e48\u60f3\u660e\u767d\u7684&#8221;\u3002 <strong>\u7b2c 12 \u7bc7 \u00b7 \u5965\u8d5b\u9898\u5e93 OlympiadMath<\/strong>\uff08\u4e0a\u4e00\u7bc7\uff1a<a href=\"https:\/\/github.com\/ghostgorge\/KeHen\">\u6838\u75d5 KeHen<\/a>\uff09 \u6e90\u7801\uff1a<a href=\"https:\/\/github.com\/ghostgorge\/OlympaidMath\">github.com\/ghostgorge\/OlympaidMath<\/a> Python + Tkinter \u684c\u9762\u7a0b\u5e8f\uff0c\u5355\u6587\u4ef6 exe\uff0c\u5c0f\/\u521d\/\u9ad8\u4e09\u6863\u5171 72 \u9053\u9898<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u5148\u8bf4\u8fd9\u662f\u4e2a\u4ec0\u4e48\u4e1c\u897f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5c0f\u5b66 \/ \u521d\u4e2d \/ \u9ad8\u4e2d\u4e09\u6863\u6570\u5b66\u5965\u8d5b\u9898\u5e93\uff0c\u516c\u5f0f\u7528 LaTeX \u663e\u793a\uff0c<strong>\u5168\u90e8\u9898\u76ee\u7b14\u7b97\u5373\u53ef<\/strong>\uff08\u4e0d\u9700\u8981\u8ba1\u7b97\u5668\u3001\u4e0d\u9700\u8981\u7f16\u7a0b\uff09\uff0c\u6bcf\u9898\u7ed9<strong>\u63d0\u793a \/ \u601d\u8def \/ \u5b8c\u6574\u89e3\u7b54 \/ \u7b54\u6848<\/strong>\u56db\u5c42\u5e2e\u52a9\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u5b66\u6bb5<\/th><th>\u9898\u6570<\/th><th>\u96be\u5ea6\u5206\u5e03<\/th><th>\u8986\u76d6\u4e13\u9898<\/th><\/tr><\/thead><tbody><tr><td>\u5c0f\u5b66<\/td><td>24<\/td><td>\u26051 \/ <br>\u2605\u260511 \/ <br>\u2605\u2605\u26059 \/ <br>\u2605\u2605\u2605\u26053<\/td><td>\u5de7\u7b97\u3001\u884c\u7a0b\u3001\u5de5\u7a0b\u3001\u6570\u8bba\u3001\u5468\u671f\u3001\u62bd\u5c49\u3001\u8ba1\u6570\u3001\u51e0\u4f55\u3001\u6570\u9635\u56fe\u3001\u903b\u8f91\u63a8\u7406\u3001\u6700\u503c<\/td><\/tr><tr><td>\u521d\u4e2d<\/td><td>24<\/td><td>\u2605\u26059 \/ <br>\u2605\u2605\u260510 \/ <br>\u2605\u2605\u2605\u26054 \/ <br>\u2605\u2605\u2605\u2605\u26051<\/td><td>\u4ee3\u6570\u53d8\u5f62\u3001\u6570\u8bba\u3001\u5e73\u9762\u51e0\u4f55\u3001\u7ec4\u5408\u3001\u4e0d\u7b49\u5f0f<\/td><\/tr><tr><td>\u9ad8\u4e2d<\/td><td>24<\/td><td>\u2605\u26055 \/ <br>\u2605\u2605\u260510 \/ <br>\u2605\u2605\u2605\u26056 \/ <br>\u2605\u2605\u2605\u2605\u26053<\/td><td>\u4e09\u89d2\u3001\u6570\u5217\u3001\u590d\u6570\u3001\u51fd\u6570\u65b9\u7a0b\u3001\u6570\u8bba\u3001\u7ec4\u5408\u51e0\u4f55\u3001\u7acb\u4f53\u51e0\u4f55\u3001\u89e3\u6790\u51e0\u4f55\u3001\u6982\u7387\u3001\u4e0d\u7b49\u5f0f<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u96be\u5ea6\u5bf9\u7167\uff1a\u2605\u2605 \u53ca\u4ee5\u4e0b\u662f\u70ed\u8eab\/\u8bfe\u5185\u62d4\u9ad8\uff0c\u2605\u2605\u2605 \u662f\u8054\u8d5b\u4e00\u8bd5\u6c34\u5e73\uff0c\u2605\u2605\u2605\u2605 \u662f\u4e8c\u8bd5\u6c34\u5e73\uff0c\u2605\u2605\u2605\u2605\u2605 \u662f IMO \/ \u4e8c\u8bd5\u538b\u8f74\uff08\u6bd4\u5982 IMO 1990-3\u3001IMO 1995-2\u3001Sylvester\u2013Gallai\uff09\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u754c\u9762\u9ed8\u8ba4\u53ea\u663e\u793a\u9898\u9762<\/strong>\uff0c\u63d0\u793a\u3001\u601d\u8def\u3001\u89e3\u7b54\u3001\u7b54\u6848\u5168\u90e8\u8981\u624b\u52a8\u5c55\u5f00\u3002\u8fd9\u662f\u523b\u610f\u7684\u2014\u2014<strong>\u5148\u52a8\u7b14\uff0c\u518d\u770b<\/strong>\u3002\u4e00\u4e2a\u628a\u7b54\u6848\u9ed8\u8ba4\u644a\u5f00\u7684\u9898\u5e93\uff0c\u4f1a\u8ba9\u4eba\u4e0d\u77e5\u4e0d\u89c9\u53d8\u6210&#8221;\u770b\u89e3\u7b54&#8221;\u800c\u4e0d\u662f&#8221;\u505a\u9898&#8221;\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u8fd9\u4e2a\u9879\u76ee\u771f\u6b63\u7684\u6280\u672f\u6d3b\uff1a\u4e2d\u6587\u548c\u516c\u5f0f\u6392\u5728\u4e00\u884c<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Tkinter \u6ca1\u6709\u516c\u5f0f\u6392\u7248\u80fd\u529b\u3002\u5e38\u89c1\u7684\u51e0\u79cd\u505a\u6cd5\u90fd\u6709\u786c\u4f24\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u505a\u6cd5<\/th><th>\u95ee\u9898<\/th><\/tr><\/thead><tbody><tr><td>\u6574\u6bb5\u4e22\u7ed9 matplotlib \u6e32\u67d3\u6210\u56fe<\/td><td>\u4e2d\u6587\u8981\u7ed9 matplotlib \u914d\u4e2d\u6587\u5b57\u4f53\uff08\u6253\u5305\u540e\u7ecf\u5e38\u7f3a\uff09\uff1b\u6574\u6bb5\u53d8\u6210\u56fe\uff0c<strong>\u4e0d\u80fd\u9009\u4e2d\u3001\u4e0d\u80fd\u590d\u5236\u3001\u4e0d\u80fd\u81ea\u52a8\u6362\u884c<\/strong><\/td><\/tr><tr><td>\u5d4c\u4e00\u4e2a\u6d4f\u89c8\u5668\u63a7\u4ef6\u8dd1 MathJax<\/td><td>\u62d6\u8fdb\u6765\u4e00\u4e2a\u51e0\u5341 MB \u7684\u8fd0\u884c\u65f6\uff0c\u5355\u6587\u4ef6 exe \u76f4\u63a5\u5e9f\u6389<\/td><\/tr><tr><td>\u516c\u5f0f\u9000\u5316\u6210\u7eaf\u6587\u672c<\/td><td>\u7a0d\u5fae\u590d\u6742\u4e00\u70b9\u5c31\u6ca1\u6cd5\u770b<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u7684\u65b9\u6848\u662f<strong>\u6df7\u6392<\/strong>\uff0c\u4e00\u53e5\u8bdd\u6982\u62ec\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u4e2d\u6587\u4e0d\u8fdb matplotlib\u3002<\/strong><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u5177\u4f53\u505a\u6cd5\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6574\u884c\u6587\u672c\u6309 <code>$<\/code> \u5207\u5f00<\/li>\n\n\n\n<li><strong>\u4e2d\u6587\u548c\u666e\u901a\u5b57\u7b26<\/strong>\u7528 Tk \u539f\u751f\u5b57\u4f53\u76f4\u63a5\u5199\u8fdb <code>Text<\/code> \u63a7\u4ef6\u2014\u2014<strong>\u53ef\u9009\u4e2d\u3001\u53ef\u590d\u5236\u3001\u81ea\u52a8\u6362\u884c<\/strong><\/li>\n\n\n\n<li>\u53ea\u6709 <code>$...$<\/code> \u91cc\u7684<strong>\u516c\u5f0f<\/strong>\u4ea4\u7ed9 matplotlib \u7684 mathtext \u5149\u6805\u5316\uff0c\u8d34\u6210<strong>\u884c\u5185\u56fe\u7247<\/strong><\/li>\n\n\n\n<li>\u7528 mathtext \u8fd4\u56de\u7684 <code>depth<\/code> \u548c\u5f53\u524d\u5b57\u4f53\u7684 <code>descent<\/code> \u505a<strong>\u57fa\u7ebf\u5bf9\u9f50<\/strong><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c 4 \u6b65\u662f\u5173\u952e\u3002\u884c\u5185\u516c\u5f0f\u5982\u679c\u4e0d\u505a\u57fa\u7ebf\u5bf9\u9f50\uff0c\u5206\u6570\u7ebf\u548c\u6c49\u5b57\u5e95\u90e8\u4f1a\u9519\u5f00\u4e00\u4e24\u4e2a\u50cf\u7d20\u2014\u2014<strong>\u770b\u8d77\u6765\u8bf4\u4e0d\u51fa\u54ea\u91cc\u602a\uff0c\u4f46\u5c31\u662f\u5f88\u602a<\/strong>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u65b9\u6848\u7684\u8fde\u5e26\u597d\u5904\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4e0d\u9700\u8981 matplotlib \u53bb\u627e\u4e2d\u6587\u5b57\u4f53<\/strong>\uff08\u6253\u5305\u540e\u6700\u5bb9\u6613\u51fa\u95ee\u9898\u7684\u4e00\u73af\u76f4\u63a5\u7ed5\u5f00\uff09<\/li>\n\n\n\n<li>\u56fe\u7247\u53ea\u5305\u542b\u516c\u5f0f\uff0c<strong>\u4f53\u79ef\u5c0f\u3001\u7f13\u5b58\u547d\u4e2d\u7387\u9ad8<\/strong>\uff08\u540c\u4e00\u4e2a\u516c\u5f0f\u5728\u63d0\u793a\u548c\u89e3\u7b54\u91cc\u51fa\u73b0\u4e24\u6b21\uff0c\u53ea\u6e32\u67d3\u4e00\u6b21\uff09<\/li>\n\n\n\n<li>\u4e0d\u4f9d\u8d56 Pillow\u2014\u2014\u81ea\u5df1\u62fc PNG \u8f6c Tk <code>PhotoImage<\/code>\uff0c\u5c11\u4e00\u4e2a\u4f9d\u8d56<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001mathtext \u53ea\u652f\u6301 LaTeX \u7684\u4e00\u4e2a\u5b50\u96c6<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">matplotlib \u7684 mathtext \u4e0d\u662f\u5b8c\u6574\u7684 LaTeX\uff0c\u5f88\u591a\u5e38\u89c1\u5199\u6cd5\u5b83\u4e0d\u8ba4\uff1a<code>\\ge<\/code>\u3001<code>\\le<\/code>\u3001<code>\\pmod<\/code>\u3001<code>\\frac1x<\/code>\uff08\u4e0d\u5e26\u82b1\u62ec\u53f7\uff09\u3001<code>\\underbrace<\/code>\u3001<code>\\displaystyle<\/code>\u3001<code>\\tfrac<\/code>\u3001<code>\\bigl<\/code>\u2026\u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e24\u4e2a\u9009\u62e9\uff1a<strong>\u8981\u6c42\u9898\u5e93\u6309 mathtext \u7684\u89c4\u77e9\u5199<\/strong>\uff0c\u6216\u8005<strong>\u5199\u4e00\u4e2a\u517c\u5bb9\u5c42<\/strong>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u9009\u4e86\u540e\u8005\uff08<code>app\/latexfix.py<\/code>\uff09\uff0c\u7406\u7531\u5f88\u5b9e\u9645\uff1a<strong>\u9898\u5e93\u662f\u8981\u7ed9\u4eba\u5199\u7684\uff0c\u800c\u4eba\u4f1a\u6309\u6b63\u5e38 LaTeX \u4e60\u60ef\u5199\u3002<\/strong> \u4e00\u4e2a&#8221;\u5fc5\u987b\u8bb0\u4f4f\u54ea\u4e9b\u547d\u4ee4\u4e0d\u80fd\u7528&#8221;\u7684\u9898\u5e93\u683c\u5f0f\uff0c\u4f1a\u5728\u7b2c 10 \u9053\u9898\u7684\u65f6\u5019\u88ab\u653e\u5f03\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u517c\u5bb9\u5c42\u7684\u6210\u672c\u662f\u4e00\u6b21\u6027\u7684\uff0c\u800c&#8221;\u8981\u6c42\u6240\u6709\u4eba\u8bb0\u4f4f\u9650\u5236&#8221;\u7684\u6210\u672c\u662f\u6bcf\u6b21\u90fd\u8981\u4ed8\u7684\u3002<\/strong><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u964d\u7ea7\u8981\u80fd\u964d\u5f97\u4e0b\u53bb<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>matplotlib \u88c5\u4e0d\u4e0a\u4e5f\u80fd\u8dd1<\/strong>\u2014\u2014\u516c\u5f0f\u4f1a\u9000\u5316\u6210\u53ef\u8bfb\u7684\u7eaf\u6587\u672c\uff08<code>(1)\/(2)<\/code>\u3001<code>\u221a(3)<\/code> \u8fd9\u79cd\uff09\uff0c\u7a0b\u5e8f\u4e0d\u5d29\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u6761\u770b\u8d77\u6765\u662f\u5c0f\u4e8b\uff0c\u4f46\u5b83\u51b3\u5b9a\u4e86\u8fd9\u4e2a exe \u80fd\u4e0d\u80fd\u968f\u624b\u53d1\u7ed9\u4e00\u4e2a\u4e0d\u61c2\u6280\u672f\u7684\u4eba\u3002<strong>\u4e00\u4e2a&#8221;\u7f3a\u4e86\u67d0\u4e2a\u5e93\u5c31\u767d\u5c4f&#8221;\u7684\u5de5\u5177\uff0c\u7b49\u4e8e\u8981\u6c42\u6bcf\u4e2a\u7528\u6237\u90fd\u4f1a\u914d\u73af\u5883\u3002<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001\u6253\u5305\u8fd9\u4e00\u8282\uff0c\u53ef\u80fd\u662f\u5168\u7cfb\u5217\u6700\u6709\u590d\u7528\u4ef7\u503c\u7684<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u9879\u76ee\u7684 <code>build_exe.bat<\/code> \u548c spec \u91cc\u9884\u5148\u89c4\u907f\u7684\u5751\uff0c\u51e0\u4e4e\u662f\u6211\u8fd9\u4e24\u5e74\u6240\u6709 PyInstaller \u7ecf\u9a8c\u7684\u5408\u96c6\u3002\u6328\u6761\u5217\u4e00\u4e0b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5173\u4e8e matplotlib\uff08\u8fd9\u6761\u662f\u8fd9\u4e2a\u9879\u76ee\u72ec\u6709\u7684\uff09<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><code>MPLCONFIGDIR<\/code> \u5fc5\u987b\u56fa\u5b9a\u5230 <code>%APPDATA%\\OlympiadMath\\mplcache<\/code>\u3002 \u5426\u5219<strong>\u5355\u6587\u4ef6 exe \u6bcf\u6b21\u542f\u52a8\u90fd\u8981\u91cd\u5efa matplotlib \u5b57\u4f53\u7f13\u5b58\uff0c\u9996\u6b21\u6e32\u67d3\u516c\u5f0f\u8981\u7b49\u5341\u51e0\u79d2<\/strong>\u2014\u2014\u7528\u6237\u4f1a\u4ee5\u4e3a\u7a0b\u5e8f\u5361\u6b7b\u4e86\u3002<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u5355\u6587\u4ef6 exe \u6bcf\u6b21\u8fd0\u884c\u90fd\u89e3\u538b\u5230\u4e00\u4e2a\u65b0\u7684\u4e34\u65f6\u76ee\u5f55\uff0cmatplotlib \u627e\u4e0d\u5230\u4e0a\u6b21\u7684\u7f13\u5b58\uff0c\u4e8e\u662f\u6bcf\u6b21\u90fd\u91cd\u5efa\u3002\u8fd9\u4e2a\u95ee\u9898\u53ea\u5728\u6253\u5305\u540e\u51fa\u73b0\uff0c\u6e90\u7801\u8fd0\u884c\u65f6\u5b8c\u5168\u6b63\u5e38\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5173\u4e8e pywin32<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">spec \u91cc\u6392\u9664 <code>pythoncom \/ pywintypes \/ win32com \/ win32api<\/code>\uff0c\u5e76\u7528 <code>pyi_hooks\/<\/code> \u91cc\u7684<strong>\u7a7a hook \u8986\u76d6\u5b98\u65b9 hook<\/strong>\u3002\u539f\u56e0\uff1a\u673a\u5668\u4e0a pywin32 \u88c5\u4e86\u4f46\u6ca1\u8dd1 postinstall \u65f6\uff0c\u5b98\u65b9 hook \u4f1a\u5728 Analysis \u9636\u6bb5\u76f4\u63a5\u5d29\uff08\u62a5 <code>Failed to retrieve attribute __file__ from module pythoncom<\/code>\uff09\uff0c<strong>\u8ddf\u4f60\u7684\u7a0b\u5e8f\u6beb\u65e0\u5173\u7cfb<\/strong>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5173\u4e8e excludes \u7684\u8fb9\u754c<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u4e0d\u80fd\u6392\u9664\u6807\u51c6\u5e93\u548c setuptools<\/strong>\u2014\u2014PyInstaller \u7684\u8fd0\u884c\u65f6 hook \u4f9d\u8d56\u5b83\u4eec\uff0c\u6392\u6389\u540e exe \u4e00\u542f\u52a8\u5c31\u5d29\u5728 <code>pyi_rth_pkgres.py<\/code>\u3002 excludes \u53ea\u7528\u6765\u6392 matplotlib\/scipy\/PyQt \u8fd9\u7c7b\u91cd\u578b\u7b2c\u4e09\u65b9\u5e93\u3002<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5173\u4e8e&#8221;\u53cc\u51fb\u6ca1\u53cd\u5e94&#8221;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>console=False<\/code> \u4e0b <code>sys.stdout<\/code> \u53ef\u80fd\u662f <code>None<\/code>\uff0c\u5165\u53e3\u5904\u4efb\u4f55\u4e00\u53e5 <code>print()<\/code> \u90fd\u4f1a <code>AttributeError<\/code>\u2014\u2014<strong>\u53c8\u4e00\u79cd&#8221;\u53cc\u51fb\u6ca1\u53cd\u5e94&#8221;<\/strong>\u3002\u6240\u4ee5\u5165\u53e3\u88c5\u4e86\u9ed1\u6d1e\u6d41\u515c\u5e95\uff0c\u542f\u52a8\u5168\u7a0b\u5305\u5728 try \u91cc\uff0c\u51fa\u9519\u5199\u65e5\u5fd7\uff08<code>%APPDATA%\\OlympiadMath\\startup.log<\/code>\uff09\u5e76\u5f39 MessageBox\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6392\u67e5\u624b\u6bb5\u662f\u6253\u4e00\u4e2a <code>build_exe_debug.bat<\/code>\uff08onedir + \u5e26\u63a7\u5236\u53f0\uff09\uff1a<strong>\u80fd\u8dd1\u800c\u5355\u6587\u4ef6\u4e0d\u80fd \u2192 \u95ee\u9898\u5728\u89e3\u538b\u5230 <code>%TEMP%<\/code>\uff1b\u8c03\u8bd5\u7248\u4e5f\u6302 \u2192 \u63a7\u5236\u53f0\u76f4\u63a5\u7ed9 traceback\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5173\u4e8e\u6311\u89e3\u91ca\u5668\u548c\u88c5\u4f9d\u8d56<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6309 <code>py -3.12 \u2192 3.11 \u2192 3.9 \u2192 3.8 \u2192 python<\/code> \u7684\u987a\u5e8f\u6311\uff08<strong>PATH \u91cc\u7684 python \u901a\u5e38\u662f Anaconda\uff0c\u6392\u6700\u540e<\/strong>\uff09\uff0c\u53ef\u7528 <code>set OM_PY=<\/code> \u8986\u76d6\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f9d\u8d56\u5224\u65ad<strong>\u7528 <code>import<\/code> \u800c\u4e0d\u662f pip \u7684\u9000\u51fa\u7801<\/strong>\u2014\u2014\u67d0\u4e9b\u673a\u5668\u4e0a pip \u4f1a\u56e0\u4e3a\u574f\u6389\u7684\u5305\u5143\u6570\u636e\u76f4\u63a5\u5d29\u6e83\uff08\u6bd4\u5982 <code>pyodbc<\/code> \u7684\u7248\u672c\u53f7\u5199\u6210 <code>4.0.0-unsupported<\/code>\uff0c\u4e0d\u5408 PEP 440\uff0c\u5bfc\u81f4\u8be5\u73af\u5883\u4e0b<strong>\u4efb\u4f55<\/strong> pip \u547d\u4ee4\u5728&#8221;\u5217\u51fa\u5df2\u5b89\u88c5\u5305&#8221;\u9636\u6bb5\u5c31\u9000\u51fa\u7801 2\uff09\uff0c\u8ddf\u4f60\u7684\u9879\u76ee\u6beb\u65e0\u5173\u7cfb\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u88c5\u4f9d\u8d56<strong>\u5148\u8bd5 <code>--user<\/code><\/strong> \u518d\u8bd5\u666e\u901a\u5b89\u88c5\u2014\u2014python \u88c5\u5728\u7cfb\u7edf\u76ee\u5f55\u3001\u5f53\u524d\u8d26\u53f7\u6ca1\u5199\u6743\u9650\u65f6\u4f1a\u62a5 <code>WinError 5<\/code>\u3002\u5931\u8d25\u4e86\u7ed9\u51fa\u4e09\u6761\u80fd\u7167\u7740\u505a\u7684\u4fee\u6cd5\uff0c\u800c\u4e0d\u662f\u7529\u4e00\u6bb5 traceback\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5173\u4e8e\u4ea7\u7269\u6821\u9a8c<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6253\u5b8c<strong>\u6821\u9a8c\u4f53\u79ef\uff0c\u4f4e\u4e8e 8MB \u76f4\u63a5\u5224\u5931\u8d25<\/strong>\u3002\uff08\u8fd9\u6761\u7684\u6765\u5386\u89c1<a href=\"https:\/\/github.com\/ghostgorge\/EmbserTower\">\u70ec\u5854\u90a3\u7bc7<\/a>\uff1a<code>.bat<\/code> \u6536\u5c3e\u6a2a\u5e45\u91cc\u4e00\u4e2a\u88f8\u7684 <code>&gt;<\/code> \u88ab cmd \u5f53\u6210\u91cd\u5b9a\u5411\uff0c\u628a\u521a\u6253\u597d\u7684 exe \u8986\u76d6\u6210\u4e86 11 \u5b57\u8282\u6587\u672c\u3002\uff09<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001\u4e00\u4e2a\u5f88\u5212\u7b97\u7684\u81ea\u68c0\u9879<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6253\u5305\u524d\u7684\u9898\u5e93\u81ea\u68c0\u91cc\u6709\u4e00\u6761\uff1a<strong>\u771f\u7684\u5149\u6805\u5316\u4e00\u4e2a\u6837\u4f8b\u516c\u5f0f\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b83\u5b88\u7684\u4e0d\u662f\u9898\u5e93\uff0c\u662f<strong>\u4f9d\u8d56<\/strong>\u2014\u2014matplotlib \u6362\u4e2a\u7248\u672c\u3001mathtext \u7684\u63a5\u53e3\u53d8\u4e86\uff0c\u8fd9\u6761\u4f1a\u5728<strong>\u6253\u5305\u4e4b\u524d<\/strong>\u5c31\u7ea2\uff0c\u800c\u4e0d\u662f\u7b49\u5230\u7528\u6237\u53cc\u51fb exe\u3001\u70b9\u5f00\u7b2c\u4e00\u9053\u9898\u3001\u53d1\u73b0\u516c\u5f0f\u5168\u53d8\u6210\u7ea2\u53c9\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u51e1\u662f\u4f9d\u8d56\u7b2c\u4e09\u65b9\u6e32\u67d3\/\u89e3\u6790\u7684\u529f\u80fd\uff0c\u81ea\u68c0\u91cc\u8981\u6709\u4e00\u4e2a\u771f\u6b63\u8dd1\u901a\u7aef\u5230\u7aef\u7684\u6837\u4f8b\u3002<\/strong> \u53ea\u68c0\u67e5&#8221;\u80fd import&#8221;\u662f\u4e0d\u591f\u7684\u3002<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u81ea\u68c0\u4e5f\u80fd\u5728\u7a0b\u5e8f\u91cc\u8dd1\uff08<strong>\u5e2e\u52a9 \u2192 \u9898\u5e93\u81ea\u68c0<\/strong>\uff09\uff0c\u5b83\u4f1a\u628a\u6240\u6709\u6e32\u67d3\u4e0d\u4e86\u7684\u516c\u5f0f\u5217\u51fa\u6765\u2014\u2014\u6240\u4ee5\u81ea\u5df1\u52a0\u9898\u7684\u4eba\u4e0d\u7528\u7b49\u62a5\u9519\uff0c\u5199\u5b8c\u76f4\u63a5\u81ea\u68c0\u4e00\u904d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e03\u3001\u5176\u4ed6\u529f\u80fd<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u7b5b\u9009<\/strong>\uff1a\u5b66\u6bb5 \/ \u4e13\u9898 \/ \u96be\u5ea6 \/ \u72b6\u6001\u56db\u4e2a\u7ef4\u5ea6 + \u5168\u6587\u641c\u7d22\uff08\u641c\u9898\u9762\u3001\u6807\u9898\u3001\u6807\u7b7e\u3001\u601d\u8def\uff09<\/li>\n\n\n\n<li><strong>\u7ec4\u5377<\/strong>\uff1a\u6309\u5b66\u6bb5\u548c\u96be\u5ea6\u533a\u95f4\u968f\u673a\u62bd N \u9898\uff0c\u751f\u6210&#8221;<strong>\u9898\u76ee\u5377 + \u89e3\u7b54\u5377<\/strong>&#8220;\u4e24\u4e2a\u6587\u4ef6\u3002\u53ef\u9009 Markdown \u6216\u53ef\u6253\u5370 HTML\u2014\u2014<strong>HTML \u7248\u80fd\u7559\u7b54\u9898\u7a7a\u767d\uff0c\u516c\u5f0f\u7528 MathJax \u6e32\u67d3\uff0c\u76f4\u63a5 <code>Ctrl+P<\/code> \u6253\u5370<\/strong><\/li>\n\n\n\n<li><strong>\u9519\u9898\u672c<\/strong>\uff1a\u6807\u8bb0\u9519\u9898\u540e\uff0c\u300c\u7ec3\u4e60 \u2192 \u53ea\u770b\u9519\u9898\u300d\uff0c\u6216\u7ec4\u5377\u65f6\u628a\u62bd\u9898\u8303\u56f4\u9009\u6210&#8221;\u9519\u9898&#8221;\uff0c\u5c31\u662f\u4e00\u4efd\u9519\u9898\u91cd\u505a\u5377<\/li>\n\n\n\n<li><strong>\u7b14\u8bb0<\/strong>\uff1a\u6bcf\u9898\u53ef\u4ee5\u8bb0\u81ea\u5df1\u7684\u505a\u6cd5\u548c\u5361\u4f4f\u7684\u5730\u65b9<\/li>\n\n\n\n<li><strong>\u81ea\u5df1\u52a0\u9898<\/strong>\uff1a\u628a <code>.json<\/code> \u4e22\u8fdb <code>%APPDATA%\\OlympiadMath\\\u6211\u7684\u9898\u5e93\\<\/code>\uff0c\u6309 <code>F5<\/code> \u5c31\u52a0\u8f7d\u8fdb\u6765\uff0c\u548c\u5185\u7f6e\u9898\u5e93\u4e00\u8d77\u7b5b\u9009\u3001\u7ec4\u5377<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u505a\u9898\u8bb0\u5f55\u5b58\u5728 <code>%APPDATA%\\OlympiadMath\\progress.json<\/code>\u2014\u2014<strong>\u6362\u7248\u672c\u3001\u91cd\u65b0\u6253\u5305\u90fd\u4e0d\u4f1a\u4e22<\/strong>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5feb\u6377\u952e\uff1a<code>\u2190\/\u2192<\/code> \u7ffb\u9898 \u00b7 <code>R<\/code> \u968f\u673a \u00b7 <code>H\/I\/S\/A<\/code> \u63d0\u793a\/\u601d\u8def\/\u89e3\u7b54\/\u7b54\u6848 \u00b7 <code>F<\/code> \u6536\u85cf \u00b7 <code>1\/2\/3<\/code> \u6807\u8bb0\u5df2\u638c\u63e1\/\u5f85\u590d\u4e60\/\u9519\u9898 \u00b7 <code>Ctrl+P<\/code> \u7ec4\u5377 \u00b7 <code>F5<\/code> \u91cd\u8f7d\u9898\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install matplotlib\npython main.py\npython main.py --selftest    # \u9898\u5e93\u7ed3\u6784 + \u5168\u90e8\u516c\u5f0f\u80fd\u5426\u6e32\u67d3\n\u53cc\u51fb build_exe.bat           # \u51fa dist\\OlympiadMath.exe\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5c3e\u5df4<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e24\u6761\u5e26\u5f97\u8d70\u7684\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u4e00\u3001&#8221;\u54ea\u90e8\u5206\u4ea4\u7ed9\u8c01&#8221;\u6bd4&#8221;\u7528\u4ec0\u4e48\u5e93&#8221;\u66f4\u91cd\u8981\u3002<\/strong> \u516c\u5f0f\u6392\u7248\u8fd9\u4ef6\u4e8b\uff0c\u6574\u6bb5\u4e22\u7ed9 matplotlib \u662f\u6700\u7701\u4e8b\u7684\u5199\u6cd5\uff0c\u4f46\u5b83\u540c\u65f6\u628a\u4e2d\u6587\u5b57\u4f53\u95ee\u9898\u3001\u53ef\u9009\u4e2d\u3001\u81ea\u52a8\u6362\u884c\u5168\u90fd\u8d54\u8fdb\u53bb\u4e86\u3002<strong>\u6309 <code>$<\/code> \u5207\u5f00\u3001\u5404\u4ea4\u5404\u7684<\/strong>\uff0c\u624d\u662f\u90a3\u4e2a\u521a\u597d\u7684\u8fb9\u754c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u4e8c\u3001\u517c\u5bb9\u5c42\u7684\u6210\u672c\u662f\u4e00\u6b21\u6027\u7684\uff0c&#8221;\u8981\u6c42\u6240\u6709\u4eba\u8bb0\u4f4f\u9650\u5236&#8221;\u7684\u6210\u672c\u662f\u6bcf\u6b21\u90fd\u8981\u4ed8\u7684\u3002<\/strong><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u53e6\u5916\uff0c\u8fd9\u7bc7\u91cc\u7684\u6253\u5305\u6e05\u5355\u5982\u679c\u4f60\u5728\u7528 PyInstaller\uff0c\u5efa\u8bae\u5355\u72ec\u5b58\u4e00\u4efd\u2014\u2014\u5c24\u5176 <strong><code>MPLCONFIGDIR<\/code><\/strong> \u90a3\u6761\uff0c\u5b83\u53ea\u5728\u6253\u5305\u540e\u51fa\u73b0\u3001\u53ea\u8868\u73b0\u4e3a&#8221;\u9996\u6b21\u6e32\u67d3\u8981\u7b49\u5341\u51e0\u79d2&#8221;\uff0c\u5f88\u96be\u4ece\u73b0\u8c61\u53cd\u63a8\u5230\u539f\u56e0\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udce6 <strong>\u6e90\u7801<\/strong>\uff1a<a href=\"https:\/\/github.com\/ghostgorge\/OlympaidMath\">https:\/\/github.com\/ghostgorge\/OlympaidMath<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><em>\u4e0b\u4e00\u7bc7\uff1a<strong>\u5fc3\u4e00\u7f51\u7edc\u52a9\u624b XinYiNetTool<\/strong>\u2014\u2014Python\/tkinter \u7f51\u7edc\u8fd0\u7ef4\u5de5\u5177\u7bb1\u3002\u56de\u590d\u300c\u7ee7\u7eed\u300d\u3002<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7cfb\u5217\uff1a\u628a\u8fd9\u4e24\u5e74\u7528 Python \u5199\u7684\u5341\u51e0\u4e2a\u5c0f\u9879\u76ee\u6328\u4e2a\u5f00\u6e90\u3001\u6328\u4e2a\u8bf4\u6e05\u695a\u3002\u4e0d\u8bb2&#8221;\u6211\u505a\u4e86\u4ec0\u4e48&#038;#822 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[14,15,10],"tags":[],"class_list":["post-8041","post","type-post","status-publish","format-standard","hentry","category-teacher","category-games","category-coding","entry"],"_links":{"self":[{"href":"https:\/\/www.xinyixx.com\/index.php\/wp-json\/wp\/v2\/posts\/8041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xinyixx.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xinyixx.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xinyixx.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xinyixx.com\/index.php\/wp-json\/wp\/v2\/comments?post=8041"}],"version-history":[{"count":1,"href":"https:\/\/www.xinyixx.com\/index.php\/wp-json\/wp\/v2\/posts\/8041\/revisions"}],"predecessor-version":[{"id":8042,"href":"https:\/\/www.xinyixx.com\/index.php\/wp-json\/wp\/v2\/posts\/8041\/revisions\/8042"}],"wp:attachment":[{"href":"https:\/\/www.xinyixx.com\/index.php\/wp-json\/wp\/v2\/media?parent=8041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xinyixx.com\/index.php\/wp-json\/wp\/v2\/categories?post=8041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xinyixx.com\/index.php\/wp-json\/wp\/v2\/tags?post=8041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}