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

1.1k views Asked by At

I want to do this on Linux with rar x filename.

The RAR archive file is split into parts, for example:

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

I wanted to extract them all at once with a Python script.

1

There are 1 answers

0
eccentricOrange On

I can think of three ways:

  • make a shell (such as bash) script to do this. 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.
  • use Python to run shell commands: look into os.system and "subprocesses"
  • many Python solutions here: How can unrar a file with python