#coding =utf8
Import ZipFile
From threading Import Thread
Import Argparse
def extractfile (Zfile,password):
Try
Zipfile.extractall (pwd = password)
print ' Password is Found: ' + password
Except:
Pass
def main ():
Parser = Argparse. Argumentparser (usage= '%prog ' + '-f <zipfile>-D <dictionary> ')
Parser.add_argument ('-f ', Dest=zname, Type=argparse. FileType (' ZipFile '), help = ' Specify Zip file ')
Parser.add_argument ('-d ', Dest=dname, Type=argparse. FileType (' txt '), help = ' Specify Dictioary file ')
# (Argument,args) = Parser.parse_args ()
if (Zname = = None) | (dname = = None):
Print Parser.usage
Exit (0)
Else
Dname=argument.dname
Zname=argument.zname
Zfile = ZipFile. ZipFile (Zname)
Passfiles =open (dname)
For line in Passfiles.readlines ():
Password = line.strip (' \ n ')
t = Thread (target = extractfile, args = (Zfile,password))
T.start ()
If __name__== ' __main__ ':
Main ()
This is my new perfect code, but in the implementation of the total error, at present do not know how to solve the official documents, it is not clear how to interpret, if there is any big God understand these, I hope the generous enlighten, under the grateful.
Python stunt Learning notes the next day