V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · 6316 views
    This topic created in 4978 days ago, the information mentioned may be changed or developed.
    各位有什么思路?
    有什么库推荐吗?

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