#coding=utf-
import os
import time
def verify(filePath):
print("verify--" + filePath)
list1=[]
# filePath=str(log)+'\n' for f in open(filePath, 'r',encoding = 'utf-8'):
list1+=str(f)
A = 'com.example.gcloudu3ddemo' # 检查对比的字符串
B=
C=
log=''
for verify in list1:
verify = "".join(list1[B:C])
if verify == A:
log += filePath +"======"+ A+"\n"
B +=
C += else:
B+=
C+=
return log
#verify.close() def wj(maindir):
log = ""
pathdir = os.listdir(maindir)
for a in pathdir:
nwudir = os.path.join(maindir,a) # 路径拼接
if os.path.isfile(nwudir): # 是否文件
if os.path.splitext(nwudir)[]=='.xml': #是否xml
if nwudir == 'mars_share_sdk.xml': # 剔除加密xml
pass
elif nwudir == '\AndroidManifest.xml':
pass else:
log += verify(nwudir) + "\n" else:
log += wj(nwudir) + "\n"
return log maindir='E:\\test'
log = wj(maindir)
now = time.strftime("%Y-%m-%d-%H_%M_%S",time.localtime(time.time())) # 创建文件名
fp = open("E:\\"+now+r"log.txt", 'a') # 新建log
fp.write(log.strip()) # 去除空格
fp.close() # 关闭log

检查xml文件的更多相关文章

  1. hibernate.xml文件详解

    <!--标准的XML文件的起始行,version='1.0'表明XML的版本,encoding='gb2312'表明XML文件的编码方式--> <?xml version='1.0' ...

  2. C#关于xml文件和TreeView之间的转换解析

    主窗体: using System; using System.Collections; using System.Collections.Generic; using System.Componen ...

  3. 编写xml文件不当时会出现R文件找不到情况

    1,先检查xml文件是否报错,报错的话直接找到报错行. 2,xml文件若不报错,可能是文本值得格式输入错误 比如android:text=“<0.5km”,此时的小于号就会引发错误,导致R文件找 ...

  4. 检查dtd和Xschema文件限制下的xml文件是否符合的Java文件

    先来xml文件: 1 <?xml version="1.0" encoding="utf-8"?> 2 <!DOCTYPE orders SY ...

  5. MyBatis2:config.xml文件

    前言 前一篇文章,讲了MyBatis入门,讲到了MyBatis有两个基本的配置文件,一个用来配置环境信息,一个用来写SQL语句.前者我把它命名为config.xml,config.xml的内容是: & ...

  6. 史上最全的maven的pom.xml文件详解

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

  7. Maven项目pom.xml文件详解

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

  8. struct2的structs.xml文件配置There is no Action mapped for action name 问题

    很久没写过博客,今天重新开始写,新技术太多,只有通过博客才可以不断积累,本人水平有限,如有错误,欢迎指正,谢谢 今天在MAVEN上配置web project的struct2,发现自己忽略了很多问题,再 ...

  9. 史上最全的maven pom.xml文件教程详解

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

随机推荐

  1. JVM中强引用,弱引用,软引用和幽灵引用的代码

    上代码: public class ReferenceTest { public static void main(String[] args) { //test1();//软引用 //test2() ...

  2. C# 多线程学习系列四之ThreadPool取消、超时子线程操作以及ManualResetEvent和AutoResetEvent信号量的使用

    1.简介 虽然ThreadPool.Thread能开启子线程将一些任务交给子线程去承担,但是很多时候,因为某种原因,比如子线程发生异常.或者子线程的业务逻辑不符合我们的预期,那么这个时候我们必须关闭它 ...

  3. spring boot + mybatis + druid + redis

    接上篇,使用redis做缓存 新建spring boot 工程,添加pom引用 <dependency> <groupId>org.springframework.boot&l ...

  4. 使用Jenkins部署.Net应用程序

    首先从 https://jenkins.io/download/ 下载所需的版本 这里选择Windows版本来测试. 直接安装jenkins.msi,安装完后使用Win+R输入services.msc ...

  5. TCP/IP 笔记 - 概述

    Effective communication depends on the use of a common language. 有效沟通取决于使用共同的语言 . TCP/IP协议族 一系列相关协议的 ...

  6. 轻量级web富文本框——wangEditor使用手册(2)——扩展一个“缩进”功能 demo

    最新版wangEditor: 配置说明:http://www.wangeditor.com/doc.html demo演示:http://www.wangeditor.com/wangEditor/d ...

  7. php的 $_REQUEST取值为空

    默认的 $_REQUEST 会获取 $_POST, $_GET, $_COOKIE的数据,这些可以通过查看 php.ini来确认: 由上图可以看出,获取的内容是通过 variables_order 和 ...

  8. 【IT笔试面试题整理】有序数组生成最小高度二叉树

    [试题描述]定义一个函数,输入一个有序数组生成最小高度二叉树 We will try to create a binary tree such that for each node, the numb ...

  9. rails中accepts_nested_attributes_for应用

    Model: class Blog < ActiveRecord::Base has_many :strip_rules accepts_nested_attributes_for :strip ...

  10. Spring ResponseEntity

    简单记录下 ResponseEntity 的使用方式 @RequestMapping(value="/demo1" ) public ResponseEntity demo1(){ ...