怎么用python解压分析jar包

  介绍

小编给大家分享一下怎么用python解压分析jar包,希望大家阅读完这篇文章之后都有所收获、下面让我们一起去探讨吧!

python主要用来做什么

python主要应用于:1,网络开发;2、数据科学研究;3,网络爬虫;4、嵌入式应用开发,5日游戏开发;6桌面应用开发。

代码如下:

#, - *安康;编码:utf-8  - * -   import 操作系统   import  shutil   import  zipfile   ,   count =1   def  getSumDir ():   时间=sumfilelist 才能;os.listdir (os.getcwd ())   for 才能;dir  sumfilelist:拷贝   ,,,if “.idea", not 拷贝dir:   ,,,,,(dir)进行分类   ,   ,   def  getlibDir ():   时间=sumfilelist 才能;os.listdir (os.getcwd ())   for 才能;dir  sumfilelist:拷贝   ,,,if “libs", dir:拷贝   ,,,,,jieyajar (dir)   ,   ,   def  jieyajar (dir):   时间=files 才能;os.listdir (dir)   for 才能;jars 拷贝文件:   ,,,if “jar",拷贝罐:   ,,,,,zfile =, zipfile.ZipFile (& # 39; libs/& # 39;, +, jar, & # 39; " # 39;)   ,,,,,if  not  os.path.exists (os.getcwd (), +, & # 39;/jarlog & # 39;, +, jar):   ,,,,,,,os.makedirs (os.getcwd (), +, & # 39;/jarlog & # 39;, +,罐子)   ,,,,,zfile.extractall (os.getcwd (), +, & # 39;/jarlog & # 39;, +,罐子)   ,   ,,,,,if  not  os.path.exists (os.getcwd(), +, & # 39;/罐/& # 39;):   ,,,,,,,os.makedirs (os.getcwd(), +, & # 39;/罐/& # 39;)   ,,,,,zfile.extractall (os.getcwd(), +, & # 39;/罐/& # 39;)   ,,,,zfile.close   ,   for 才能;file 拷贝os.listdir (os.getcwd ()):   ,,,if “jars",拷贝文件:   ,,,,,分类(文件)   ,   ,   #,def 分类(路径):   #,,,if  os.path.isfile(路径):   #,,,,,if “.class", not 拷贝路径:   #,,,,,,,if “assets",拷贝os.path.dirname(路径):   #,,,,,,,,,if  not  os.path.exists (os.path.dirname (os.getcwd()), +, & # 39;/资产/& # 39;,+,os.path.dirname(路径):   #,,,,,,,,,,,os.makedirs (os.path.dirname (os.getcwd()), +, & # 39;/资产/& # 39;,+,os.path.dirname(路径))   #,,,,,,,,,shutil.copy(路径,os.path.dirname (os.getcwd()), +, & # 39;/资产/& # 39;,+,os.path.dirname(路径))   #,,,,,,,其他的:   #,,,,,,,,,if  not  os.path.exists (os.path.dirname (os.getcwd()) + & # 39;/根/& # 39;+ os.path.dirname(路径):   #,,,,,,,,,,os.makedirs (os.path.dirname (os.getcwd()) + & # 39;/根/& # 39;+ os.path.dirname(路径))   #,,,,,,,,,shutil.copy(路径,os.path.dirname (os.getcwd()) + & # 39;/根/& # 39;+ os.path.dirname(路径))   #,,,else :   #,,,,,list =, os.listdir(路径)   #,,,,,for  dir 拷贝列表:   #,,,,,,,分类(路径+“/? dir)   ,   def 分类(路径):   global 才能;计数   if 才能os.path.isfile(路径):   ,,,if “.class", not 拷贝路径:   ,,,,,if  not  os.path.exists (os.getcwd(), +, & # 39;/根/& # 39;,+,os.path.dirname(路径):   ,,,,,,,os.makedirs (os.getcwd(), +, & # 39;/根/& # 39;,+,os.path.dirname(路径))   ,,,,,shutil.copy(路径,os.getcwd(), +, & # 39;/根/& # 39;,+,os.path.dirname(路径))   其他的才能:   ,,,if  & # 39;资产# 39;,拷贝path 以及count ==, 1:   ,,,,,count =, count  + 1   ,,,,,shutil.copytree (os.getcwd() + & # 39;/& # 39; +路径,os.getcwd(), +, & # 39;/资产# 39;)   ,,,elif  & # 39; meta - inf # 39;, not 拷贝路径:   ,,,,,list =, os.listdir(路径)   ,,,,,for  dir 拷贝列表:   ,,,,,,,分类(时间+ path “/? +, dir)   ,   ,   #,getSumDir ()   null

怎么用python解压分析jar包