diff --git a/工具/修改题目数据库.ipynb b/工具/修改题目数据库.ipynb index 724c0b71..7e7d183a 100644 --- a/工具/修改题目数据库.ipynb +++ b/工具/修改题目数据库.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 5, + "execution_count": 1, "metadata": {}, "outputs": [ { @@ -11,7 +11,7 @@ "0" ] }, - "execution_count": 5, + "execution_count": 1, "metadata": {}, "output_type": "execute_result" } @@ -19,7 +19,7 @@ "source": [ "import os,re,json\n", "\"\"\"这里编辑题号(列表)后将在vscode中打开窗口, 编辑后保存关闭, 随后运行第二个代码块\"\"\"\n", - "problems = \"20035\"\n", + "problems = \"3138\"\n", "\n", "def generate_number_set(string,dict):\n", " string = re.sub(r\"[\\n\\s]\",\"\",string)\n", diff --git a/工具/题号选题pdf生成.ipynb b/工具/题号选题pdf生成.ipynb index 08beb360..2e25e13b 100644 --- a/工具/题号选题pdf生成.ipynb +++ b/工具/题号选题pdf生成.ipynb @@ -188,7 +188,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.15" + "version": "3.9.15 (main, Nov 24 2022, 14:39:17) [MSC v.1916 64 bit (AMD64)]" }, "orig_nbformat": 4, "vscode": { diff --git a/文本处理工具/剪贴板圆圈数字生成.ipynb b/文本处理工具/剪贴板圆圈数字生成.ipynb new file mode 100644 index 00000000..79699604 --- /dev/null +++ b/文本处理工具/剪贴板圆圈数字生成.ipynb @@ -0,0 +1,73 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import os,re\n", + "import win32clipboard as wc\n", + "import win32con\n", + "\n", + "# 获取剪切板内容\n", + "def getCopy():\n", + " wc.OpenClipboard()\n", + " t = wc.GetClipboardData(win32con.CF_UNICODETEXT)\n", + " wc.CloseClipboard()\n", + " return t\n", + "\n", + "# 写入剪切板内容\n", + "def setCopy(str):\n", + " wc.OpenClipboard()\n", + " wc.EmptyClipboard()\n", + " wc.SetClipboardData(win32con.CF_UNICODETEXT, str)\n", + " wc.CloseClipboard()\n", + "\n", + "\n", + "data = getCopy()\n", + "\n", + "modified_data = re.sub(r\"\\((\\d)\\)\",lambda x: \"\\\\textcircled{\"+x.group(1)+\"}\",data)\n", + "\n", + "setCopy(modified_data)\n", + "\n", + "with open(\"临时文件/outputfile.txt\",\"w\",encoding = \"utf8\") as f:\n", + " f.write(modified_data)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "mathdept", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.15" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "ff3c292c316ba85de6f1ad75f19c731e79d694e741b6f515ec18f14996fe48dc" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/文本处理工具/剪贴板文本整理_mathpix.ipynb b/文本处理工具/剪贴板文本整理_mathpix.ipynb index 6b80b9f4..dfa6d7b3 100644 --- a/文本处理工具/剪贴板文本整理_mathpix.ipynb +++ b/文本处理工具/剪贴板文本整理_mathpix.ipynb @@ -329,6 +329,8 @@ "modified_data = modified_data.replace(\"针角\",\"钝角\")\n", "modified_data = re.sub(\"投郑\",\"投掷\",modified_data)\n", "modified_data = re.sub(\"抛郑\",\"抛掷\",modified_data)\n", + "modified_data = re.sub(\"范目\",\"范围\",modified_data)\n", + "\n", "#mathpix的自由向量修改\n", "modified_data = modified_data.replace(r\"\\vec\",r\"\\overrightarrow \")\n", "modified_data = modified_data.replace(r\"\\bar\",r\"\\overline \")\n", @@ -396,7 +398,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.15 (main, Nov 24 2022, 14:39:17) [MSC v.1916 64 bit (AMD64)]" + "version": "3.9.15" }, "orig_nbformat": 4, "vscode": {