📅  最后修改于: 2022-03-11 14:47:17.284000             🧑  作者: Mango
name = input("Enter file:")
if len(name) < 1 : name = "mbox-short.txt"
handle = open(name)
count = 0
for i in handle:
if i.startswith("From "):
a = i.split()
b = a[1]
if b.startswith("cwen"):
count+= 1
if count == 5:
print(b,count)