From d614af6605130fb044110de119c2057bab1b78d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E5=A4=A9=E5=A7=BF?= Date: Wed, 8 Jul 2020 02:05:18 +0800 Subject: [PATCH] object --- MindSpore/src/step1/object.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 MindSpore/src/step1/object.py diff --git a/MindSpore/src/step1/object.py b/MindSpore/src/step1/object.py new file mode 100644 index 0000000..7c17ed5 --- /dev/null +++ b/MindSpore/src/step1/object.py @@ -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