Created
May 31, 2011 04:46
-
-
Save kk6/999878 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf-8 | |
# ANS-progのurl:http://answer.pythonpath.jp/questions/248/ | |
# 「よく使う/全然使わない標準モジュールはなんですか?」 | |
# で名前の上がっているよく使われている標準モジュールTOP10 | |
# 今は数が少ないので手計算でもいいけどCounter使ってみたかったので。 | |
import collections | |
with open('commonly-used-modulelist.txt', 'r') as load_file: | |
items = [item.strip('\n') for item in load_file.readlines()] | |
c = collections.Counter(items) | |
for i in c.most_common(10): | |
print("{0:<30}:{1:>3}".format(i[0], i[1])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment