旨在快速统计微信群各种 群接龙的未填写名单,节省时间。
使用方法:脚本同目录下创建examed.txt和name.txt,录入群接龙姓名名单。
前者为每天已接龙的名单,后者为全部成员名单。注:两个名单首行不要出现换行。
运行脚本即可。
#一个用于检查未接龙姓名的小程序
def get_name():
with open('name.txt', 'r', encoding='utf-8') as f:
length = len(f.readlines())
with open('name.txt','r',encoding='utf-8') as f:
a= []
for i in range(0,length):
a.append(f.readline().replace('\r','').replace('\n','').replace(str(i+1) + '. ',''))
return a
def exam_name(name_list):
with open('examed.txt','r',encoding='utf-8') as f:
length = len(f.readlines())
with open('examed.txt','r',encoding='utf-8') as f:
for i in range(0,length+1):
name = f.readline().replace('\r','').replace('\n','').replace(str(i+1) + '. ','')
if name in name_list:
name_list.remove(name)
return name_list
if __name__ == '__main__':
print(exam_name(get_name()))
效果展示: