20230127 evening

This commit is contained in:
weiye.wang 2023-01-27 20:56:03 +08:00
parent 79ca0684a0
commit a51c57e384
4 changed files with 80 additions and 5 deletions

View File

@ -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",

View File

@ -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": {

View File

@ -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
}

View File

@ -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": {