You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
自己写一个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}")
希望可以添加一个批量翻译文章的功能,有时后文章太多手动添加很麻烦
The text was updated successfully, but these errors were encountered: