|
@@ -1,3 +1,5 @@
|
|
|
+import os
|
|
|
+
|
|
|
|
|
|
def analysis(data):
|
|
|
"""
|
|
@@ -30,9 +32,12 @@ def analysis(data):
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
- d = [16, 17, 18, 19, 20, 21]
|
|
|
- for item in d:
|
|
|
- path = "summary_tag_03{}_spider.txt".format(item)
|
|
|
- with open(path, encoding="utf-8") as f2:
|
|
|
- data2 = f2.readlines()
|
|
|
- analysis(data2)
|
|
|
+ path = "result"
|
|
|
+ files = os.listdir(path)
|
|
|
+ for file in files:
|
|
|
+ if file.endswith(".txt"):
|
|
|
+ fp = os.path.join(path, file)
|
|
|
+ with open(path, encoding="utf-8") as f2:
|
|
|
+ data2 = f2.readlines()
|
|
|
+ analysis(data2)
|
|
|
+
|