Python Unrar uncompressed

Source: Internet
Author: User
Tags rar

Class Unrarmodel:    def __init__ (self, filepath):        Self.rar = Rarfile. Rarfile (filepath)        self.infolist = Self.rar.infolist ()    def extral_list (self, selected_dir):        selected_ Infolist = [] for        D in Selected_dir:            for info in self.infolist:                filename = info.filename.replace ("\ \", "/") 
   # in Win                if Filename.find (d)! =-1 and Info.file_size! = 0L:                    selected_infolist.append (info)        return Selected_infolist    def decompression_list (self, Selected_infolist, To_dir): "" "        Extract the Specified Directory        :p Aram selected_infolist:specified directory        :p Aram to_dir:destination        : return:        "" "        Self.rar.extractall (Path=to_dir, Members=selected_infolist)

  

def rar_decompression (From_path, To_path):    From_path = from_path.replace ("\ \", "/")  # in win    rar = rarfile. Rarfile (From_path)    Rar.extractall (To_path)    standout_print ("Info:decompression%s to%s finish."% (From_path , To_path)) def remove_file (File_path): "" "    Remove file    :p Aram File_path:    : return:    " "" Os.remove (File_path)    standout_print ("Info:remove files%s finish."% File_path)

  

Python Unrar uncompressed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.