- Removed trailing whitespace and ensured files end with a single newline in cleanup_unused_files.py. - Added fix_trailing_whitespace.py to batch remove trailing whitespace from Python files. - Updated install_dependencies.py to improve dependency installation prompts. - Cleaned up pick_coords.py by removing unnecessary whitespace and improving code readability. - Enhanced region_selector.py by disabling specific pylint checks for better compatibility with third-party libraries. - Improved WPS流程图生成工具.py by cleaning up whitespace and enhancing readability. - Updated __init__.py in typings to remove unnecessary lines. - Modified app.js to adjust default configuration values and clean up unused code.
47 lines
1.6 KiB
Python
47 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
import os
|
|
import sys
|
|
import subprocess
|
|
|
|
# 查找目标文件
|
|
target_dir = "pic/debug_captures/2025-12-31"
|
|
if os.path.exists(target_dir):
|
|
files = os.listdir(target_dir)
|
|
# 查找包含关键字的文件
|
|
target_file = None
|
|
for f in files:
|
|
if "152118" in f and "福袋倒计时_分钟" in f and "识别后" in f and "390,1110" in f:
|
|
target_file = f
|
|
break
|
|
|
|
if target_file:
|
|
# 使用绝对路径,避免编码问题
|
|
full_path = os.path.abspath(os.path.join(target_dir, target_file))
|
|
print(f"找到文件: {target_file}")
|
|
print(f"完整路径: {full_path}")
|
|
print(f"文件存在: {os.path.exists(full_path)}")
|
|
print("\n开始运行测试...\n")
|
|
|
|
# 运行测试脚本
|
|
cmd = [sys.executable, "-u", "test_real_parallel_ocr.py", full_path]
|
|
env = os.environ.copy()
|
|
env['PYTHONIOENCODING'] = 'utf-8'
|
|
env['PYTHONUNBUFFERED'] = '1'
|
|
# 实时显示输出
|
|
process = subprocess.Popen(cmd, encoding='utf-8', stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
|
|
text=True, env=env, bufsize=1, universal_newlines=True)
|
|
if process.stdout:
|
|
for line in process.stdout:
|
|
print(line, end='')
|
|
process.wait()
|
|
print(f"\n退出码: {process.returncode}")
|
|
else:
|
|
print("未找到目标文件")
|
|
print("可用文件列表(前10个):")
|
|
for f in files[:10]:
|
|
if "152118" in f:
|
|
print(f" {f}")
|
|
else:
|
|
print(f"目录不存在: {target_dir}")
|