简体   繁体   English

如何使用 Python 脚本提取多卷 RAR 存档文件?

[英]How to extract a multi-volume RAR archive file with a Python script?

I want to do this on Linux with rar x filename .我想在 Linux 上使用rar x filename执行此操作。

The RAR archive file is split into parts, for example: RAR 归档文件被分成几个部分,例如:

Filename-001.rar
Filename-002.rar
Filename-003.rar

I wanted to extract them all at once with a Python script.我想用 Python 脚本一次提取它们。

I can think of three ways:我可以想到三种方法:

  • make a shell (such as bash ) script to do this.制作一个 shell (例如bash )脚本来执行此操作。 There are many ways to do this that you can find with a Google search, so I'm not going to link them and limit you to one.您可以通过 Google 搜索找到许多方法来执行此操作,因此我不打算将它们链接起来并限制您使用一种方法。
  • use Python to run shell commands: look into os.system and "subprocesses"使用 Python 运行 shell 命令:查看os.system和“子进程”
  • many Python solutions here: How can unrar a file with python这里有很多 Python 解决方案: How can unrar a file with python

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM