You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
name = raw_input("Enter file:")
if len(name) < 1 : name = "mbox-short.txt"
handle = open(name)
counts=dict()
for line in handle:
if not line.startswith('From '): continue
line = line.rstrip().split()[5]
com=line.split(":")
count=com[0]
counts[count]=counts.get(count,0)+1
for k,v in sorted(counts.items()):
print k,v
The text was updated successfully, but these errors were encountered:
name = raw_input("Enter file:")
if len(name) < 1 : name = "mbox-short.txt"
handle = open(name)
counts=dict()
for line in handle:
if not line.startswith('From '): continue
line = line.rstrip().split()[5]
com=line.split(":")
count=com[0]
counts[count]=counts.get(count,0)+1
for k,v in sorted(counts.items()):
print k,v
The text was updated successfully, but these errors were encountered: