#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. 课程一(Neural Networks and Deep Learning),第一周(Introduction to Deep Learning)—— 0、学习目标

    1. Understand the major trends driving the rise of deep learning.2. Be able to explain how deep lear ...

  2. Python:使用异常处理来判断运行的平台

    try: import termios, TERMIOS 1 except ImportError: try: import msvcrt 2 except ImportError: try: fro ...

  3. 全网最详细的Sublime Text 3的设置字体及字体大小(图文详解)

    不多说,直接上干货! 前期博客 全网最详细的Windows里下载与安装Sublime Text *(图文详解) 全网最详细的Sublime Text 3的激活(图文详解) 你也许是如下的版本:   点 ...

  4. j2ee高级开发技术课程第十四周

    RPC(Remote Procedure Call Protocol) RPC使用C/S方式,采用http协议,发送请求到服务器,等待服务器返回结果.这个请求包括一个参数集和一个文本集,通常形成“cl ...

  5. kafka 日志结构

    1.kafka日志结构 直接举例子: 例如kafka有个名字叫 haha 的topic,那么kafka日志下面有kafka-0,kafka-1,kafka-2...,kafka-n,具体多少个,创建分 ...

  6. IDEA SQL dialect detection和Duplicated Code检测关闭

    IDEA似乎做的太多,对于Mybatis文件中的SQL语法检查可能就没有太大的必要性,Duplicated Code检测其实非常好,但是我测试使用JDBC代码的时候一堆波浪线让我很不舒服 因此将这两个 ...

  7. 腾讯、百度、网易游戏、华为Offer及笔经面经

    原文出处:http://bbs.yingjiesheng.com/forum.php?mod=viewthread&tid=1011893&fromuid=1745894 应届生上泡了 ...

  8. 本地主机访问不了nginx 页面,请求超时

    虚拟机可以正常访问nginx页面,但是电脑浏览器访问不了,一番排差,防火墙的问题. /etc/init.d/iptables stop

  9. .gvimrc配置备份

    syn on "语法支持 colorscheme murphy set go= "common conf {{ 通用配置 "set ai "自动缩进 set b ...

  10. 【IT笔试面试题整理】给定二叉树,给每层生成一个链表

    [试题描述]定义一个函数,给定二叉树,给每层生成一个链表 We can do a simple level by level traversal of the tree, with a slight ...