当前位置: 代码迷 >> 综合 >> 随手写了个python跑zip,不知道哪有问题也没报错
  详细解决方案

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

热度:97   发布时间:2023-10-18 06:06:06.0
#__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()
  相关解决方案