kojp

好吧,大家肯定都用过的,但我是第一次.chardet

  •  
  •   kojp · Mar 28, 2012 · 2685 views
    This topic created in 5237 days ago, the information mentioned may be changed or developed.
    这个模块非常有用。看了一中午的文档。最好还是感觉这个工具给力!

    下载地址
    http://pypi.python.org/packages/source/c/chardet/chardet-1.0.1.tar.gz#md5=7c28b02bca7847c13bebedaf4df6c5a3


    fp = open("gg.eml", "r")
    fo = open("gg.html","w")
    mail= email.message_from_file(fp)

    res=ParseMail(mail)
    strtype=type(res)
    print strtype.__name__
    #unicode(res,"cp936")
    #print res
    print chardet.detect(res)

    另外,这篇文章也不错。(不知道是不是原作者)
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1095 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 23:02 · PVG 07:02 · LAX 16:02 · JFK 19:02
    ♥ Do have faith in what you're doing.