object.py

This commit is contained in:
郭明月 2020-07-09 02:42:35 +08:00
parent 1b1366dd62
commit 7e7d18c0b7
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
# coding:utf-8
import re
def objectFind(objs, filepath):
n = len(objs)
with open(filepath, 'r') as f:
for line in f.readlines():
for item in objs:
if(line.replace(" ", "").startswith(item)):
n = n-1
objs.remove(item)
#print(line)
continue
f.close()
#print("n = {}".format( n))
if n == 0:
return True
else:
print(objs)
return False