سؤال

Here How can unrar a file with python we can see that some modules can be useful for extracting .rar files. But it seems that :

  • rarfile module needs unrar.dll

  • pyunpack also needs some others things (patool ?)

Is there a crossplatform module that doesn't need any external module/.dll that can extract .rar files ?

هل كانت مفيدة؟

المحلول

No. The RAR archive format is a bit odd in the sense that it has never got wide adoption. For archive formats like ZIP and GZIP, you have native support almost anywhere. RAR has always been the odd one out.

My suggestion is to create helper code which tries to load both modules and which prints a nice error message when both fail explaining to the user what she can do to fix the problem.

For Linux: "Use you distribution's package manager to install the command-line tool 'rar' or 'unrar'."

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top