随手写了个python跑zip,不知道哪有问题也没报错

#__author__byly


import zipfile
from threading import Thread
class testZip():
    #逻辑函数
    def pad(zFile,paswd):#传入zip和字典数据
            print ("test,","Access!","from'-->'pad")
            try:
                zFile.extractall(pad = paswd)#extractall函数为解压zip文件
                print ("密码为:",paswd)
                return
            except: 
                print ("错误密码")
                return
    
    #main函数
    def main():
        zFile = zipfile.ZipFile('D:\360Yun\datas\12306数据\part001.zip')#实例化
        password = open('D:\360Yun\dictionarys\7G合并字典\常用超级8位.txt','r',encoding='utf-8')#读字典包
        for line in password.readlins():
            paswd = line.strip('\n\r')
            t = Thread(target = pad, args = (zFile,paswd))#创建多线程
            t.start()
            print ("test,","Access!","from'-->'main")
        if __name__ == '__main__':
            main()

猜你喜欢

转载自blog.csdn.net/qq_34886247/article/details/80334976