Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

文章批量翻译 #342

Closed
dreamclour opened this issue Dec 25, 2024 · 2 comments
Closed

文章批量翻译 #342

dreamclour opened this issue Dec 25, 2024 · 2 comments

Comments

@dreamclour
Copy link

希望可以添加一个批量翻译文章的功能,有时后文章太多手动添加很麻烦

@FLASElxx
Copy link

我觉得你也可以先把它们合并为一个PDF文件。

@benjohn18
Copy link

自己写一个python脚本调用
dir_path = r' you paper dir'
result_dir = r'result dir'
# 获取目录下所有的 pdf 文件
file_list = os.listdir(dir_path)
file_list = [file for file in file_list if file.endswith('.pdf')]

for file in file_list:
    file_path = os.path.join(dir_path, file)  # 获取文件的完整路径

    # 执行命令cd
    try:
        # 使用subprocess.run调用终端命令
        subprocess.run(['pdf2zh', file_path, '-o', result_dir], check=True)

    except subprocess.CalledProcessError as e:
        print(f"Error converting {file}: {e}")

@Byaidu Byaidu closed this as completed Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants