擅长:python、mysql、java
<p>你可以用<a href="https://docs.python.org/3/library/collections.html#collections.Counter.most_common" rel="nofollow noreferrer">^{<cd1>}</a>也就是说</p>
<pre><code>from collections import Counter
with open('log.txt') as f:
c = Counter(f)
print(c.most_common(1))
</code></pre>
<p>这将打印计数最高的计数器条目</p>