From 6a0040580e158ccc0e817441133932c3b2b0766b Mon Sep 17 00:00:00 2001 From: HONOR Date: Wed, 16 Sep 2026 11:33:22 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E7=BB=9F=E4=B8=80=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E4=B8=AD=E6=89=80=E6=9C=89=E8=B7=AF=E5=BE=84=E7=9A=84=E6=96=9C?= =?UTF-8?q?=E6=9D=A0=E5=88=86=E9=9A=94=E7=AC=A6=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/gui.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/ui/gui.py b/src/ui/gui.py index 5b336cc..5bf3ddd 100644 --- a/src/ui/gui.py +++ b/src/ui/gui.py @@ -197,15 +197,16 @@ class BatchTableExtractorApp: filetypes=[("Word 文档", "*.doc *.docx"), ("所有文件", "*.*")] ) if path: + path = os.path.normpath(path) self.src_path_var.set(path) if not self.out_dir_var.get().strip(): base_dir = path if self.mode_var.get() == "dir" else os.path.dirname(path) - self.out_dir_var.set(os.path.join(base_dir, "convert")) + self.out_dir_var.set(os.path.normpath(os.path.join(base_dir, "convert"))) def _browse_out(self): path = filedialog.askdirectory(title="选择输出目录") if path: - self.out_dir_var.set(path) + self.out_dir_var.set(os.path.normpath(path)) def _on_drop_files(self, files): if not files: @@ -231,15 +232,15 @@ class BatchTableExtractorApp: if os.path.isdir(first_path): self.mode_var.set("dir") self._on_mode_change() - self.src_path_var.set(first_path) + self.src_path_var.set(os.path.normpath(first_path)) if not self.out_dir_var.get().strip(): - self.out_dir_var.set(os.path.join(first_path, "convert")) + self.out_dir_var.set(os.path.normpath(os.path.join(first_path, "convert"))) elif os.path.isfile(first_path): self.mode_var.set("file") self._on_mode_change() - self.src_path_var.set(first_path) + self.src_path_var.set(os.path.normpath(first_path)) if not self.out_dir_var.get().strip(): - self.out_dir_var.set(os.path.join(os.path.dirname(first_path), "convert")) + self.out_dir_var.set(os.path.normpath(os.path.join(os.path.dirname(first_path), "convert"))) if self.auto_extract_var.get(): self.root.after(100, self._start)