推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
engHacker
V2EX  ›  Python

怎么实现Python批量统计字数?

  •  
  •   engHacker · Sep 22, 2012 · 6703 views
    This topic created in 5171 days ago, the information mentioned may be changed or developed.
    各位有什么思路?
    有什么库推荐吗?

    谢谢
    7 replies  •  1970-01-01 08:00:00 +08:00
    twm
    twm
    Sep 22, 2012
    1
    什么叫“批量统计字数”
    mckelvin
    mckelvin
    Sep 22, 2012
    2
    LZ你是说统计不同word的count吗?典型的mapreduce问题呀,需要并行计算的话可以用multiprocessing或者豆瓣开源的dpark
    reus
    reus
    Sep 22, 2012
    4
    这不学过python的都应该会的吗?这还需要什么库啊
    dreampuf
    dreampuf
    Sep 22, 2012
    5
    for f in os.listdir("."):
    with open(f) as fhandler:
    print fhandler.read().count("WORD")
    engHacker
    engHacker
    OP
    Nov 20, 2012
    6
    谢谢各位,我都忘记这回事了,@fanzheng 多谢!
    yegle
    yegle
    Dec 7, 2012
    7
    标准面试题。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1443 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 16:50 · PVG 00:50 · LAX 08:50 · JFK 11:50
    ♥ Do have faith in what you're doing.