From 25506c6e183cebdb902b85334405858f3bc0de00 Mon Sep 17 00:00:00 2001 From: 512song Date: Sun, 10 Oct 2021 18:24:18 +0800 Subject: [PATCH] 20211010 --- 文件管理1.ipynb | 40 ++++++++-------------------------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/文件管理1.ipynb b/文件管理1.ipynb index f7672b8..6718fb3 100644 --- a/文件管理1.ipynb +++ b/文件管理1.ipynb @@ -45,7 +45,7 @@ " dict1[int(m_name.split('.')[0])] = [sheet.cell(n,2).value.strip(),sheet.cell(n,5).value.strip()]\n", " \n", "# 创建部门办公室 \n", - "m_path = fi_path = os.getcwd()+'/file/210924/new'\n", + "m_path = os.getcwd()+'/file/210924/new'\n", "for pn in depart:\n", " if not os.path.exists(m_path + '/' + pn):\n", " os.mkdir(m_path + '/' + pn)\n", @@ -57,7 +57,7 @@ "old.sort()\n", "for n in old: \n", " o_name = f'{fi_path}/{n}.pdf'\n", - " n_name = f'{fi_path}/new/{dict1[n][1]}/{dict1[n][0]}.pdf'\n", + " n_name = f'{fi_path}/new/{dict1[n][1]}/{str(n).rjust(5,\"0\")}-{dict1[n][0]}.pdf'\n", " if not os.path.exists(n_name):\n", " shutil.copyfile(o_name,n_name)\n", " print(n_name)\n", @@ -261,18 +261,10 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": null, "id": "d8043425-be9e-4e9e-bbfc-3a2d8885a860", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok\n" - ] - } - ], + "outputs": [], "source": [ "import docx\n", "import json\n", @@ -311,18 +303,10 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "c440b599-9c80-4072-8543-d9c381214f1d", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok\n" - ] - } - ], + "outputs": [], "source": [ "import docx\n", "import json\n", @@ -361,18 +345,10 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": null, "id": "b5e500b5-14d4-4417-8b5e-46df71a6b6b8", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "import re\n",