From f1165f6c304f6d27203d23cd777b8a7e19f9eb15 Mon Sep 17 00:00:00 2001 From: pekwsmcbf <2363164089@qq.com> Date: Wed, 27 Apr 2022 18:34:07 +0800 Subject: [PATCH] Update getdata.py --- getdata.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/getdata.py b/getdata.py index a95d76d..91fa46a 100644 --- a/getdata.py +++ b/getdata.py @@ -58,8 +58,17 @@ NUM = 0 getOne = re.findall("\d{1,2}月\d{1,2}?日.*?。+(?=\d{1,2}月\d{1,2}日)|\d{1,2}月\d{1,2}?日.*?。+(?=病例)", data) numname = 0 for i in getOne: - NUM += 1 + NUM += 1 f = open('10.txt', 'w', encoding="utf-8") f.write(i) f.close() - \ No newline at end of file + data = str(data) + date1 = re.findall("\d{1,2}月\d{1,2}日+(?=,)", data)[0] + date1 = date1.split() + time += re.findall("\d{1,2}:\d{1,2}--\d{1,2}:\d{1,2}|\d{1,2}:\d{1,2}", data) + updateFile(r"10.txt", "[0-9月\'\",:-]", "") + updateFile(r"10.txt", "日,", "。") + data = openreadtxt("10.txt") + data = str(data) + t = re.findall("(?<=。)+.*?。", data) + through += t \ No newline at end of file