From 2c3475c460fc07da44c8b9dff96af77cea7dd8a7 Mon Sep 17 00:00:00 2001 From: p3fchsltg <2371262108@qq.com> Date: Sat, 23 Apr 2022 13:22:15 +0800 Subject: [PATCH] ADD file via upload --- 陈驰昊query.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 陈驰昊query.py diff --git a/陈驰昊query.py b/陈驰昊query.py new file mode 100644 index 0000000..1ace43c --- /dev/null +++ b/陈驰昊query.py @@ -0,0 +1,24 @@ +# -*- coding: gbk -*- +import csv +import re + +case = input("请输入:") +Start_date = input("要查询的开始时间:") +End_date = input("要查询的结束时间:") +keyword = input("关键字:") +with open('test.csv', 'r', encoding='utf-8') as f: + cs = list(csv.reader(f)) + for i in cs: + name = str(i[1]) + Bdate = str(i[2]) + Edate = str(i[3]) + Time = str(i[4]) + thought = str(i[5]) + if case == name or case == " ": + if Start_date == Bdate or Start_date == " ": + if End_date == Edate or End_date == " ": + s = re.findall(keyword, thought) + if keyword == " " : + print(name + " " + Bdate + Time + thought) + elif s!=[]: + print(name+" "+Bdate+Time+thought) \ No newline at end of file