Read the complete article on how to unrar RAR archives in Python: https://blog.aspose.com/zip/extract-rar-archives-python/
Created
September 6, 2023 15:44
-
-
Save aspose-com-gists/dd833a7cfe50a68d05be202787eaf69f to your computer and use it in GitHub Desktop.
Extract RAR Files in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import aspose.zip as az | |
| # Load RAR archive | |
| with az.rar.RarArchive("archive.rar") as archive: | |
| # Extract RAR file | |
| archive.extract_to_directory("extracted_rar") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import aspose.zip as az | |
| # Load RAR archive | |
| with az.rar.RarArchive("archive.rar") as archive: | |
| # Extract the desired file entry | |
| archive.entries[0].extract("extracted_encrypted_file.txt", "password") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import aspose.zip as az | |
| # Load RAR archive | |
| with az.rar.RarArchive("archive.rar") as archive: | |
| # Extract encrypted RAR file | |
| archive.extract_to_directory("extracted_rar", "password") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import aspose.zip as az | |
| # Load RAR archive | |
| with az.rar.RarArchive("archive.rar") as archive: | |
| # Extract the desired file entries | |
| archive.entries[0].extract("extracted_file.txt") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment