defreal_work(): # 执行耗时操作 file_list = os.listdir(args.Dir) images = [] for file in file_list: extension = Path(file).suffix if extension in ['.png', '.jpg', '.jpeg', '.gif', '.svg']: images.append(os.path.join(args.Dir, file))
zip_path = f'{args.Output}' with zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED) as zipf: for image_path in images: zipf.write(image_path, arcname=image_path.split(os.sep)[-1])
Exception in thread Thread-1 (_forward_stdout): Traceback (most recent call last): File "threading.py", line 1041, in _bootstrap_inner File "threading.py", line 992, in run File "gooey\gui\processor.py", line 70, in _forward_stdout _progress = self._extract_progress(line) File "gooey\gui\processor.py", line 84, in _extract_progress find = partial(re.search, string=text.strip().decode(self.encoding)) ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcb in position 2: invalid continuation byte
defreal_work(): # 执行耗时操作 file_list = os.listdir(args.Dir) images = [] for file in file_list: extension = Path(file).suffix if extension in ['.png', '.jpg', '.jpeg', '.gif', '.svg']: images.append(os.path.join(args.Dir, file))
zip_path = f'{args.Output}' with zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED) as zipf: for image_path in images: zipf.write(image_path, arcname=image_path.split(os.sep)[-1])