推荐学习书目
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
337136897
1.07D
V2EX  ›  Python

Python 在写一个制作个性签名云图时出现了一个错误

  •  
  •   337136897 · Jul 26, 2017 · 2771 views
    This topic created in 3233 days ago, the information mentioned may be changed or developed.
    某一句代码:
    my_wordcloud=WordCloud(background_color='white',max_words=2000,
    mask=coloring,max_font_size=60,random_state=42,scale=2,
    font_path="i:simhei.ttf").generate(word_space_split)

    运行时提示错误: File "c:\WeChatOutputSignature.py", line 50, in <module>
    font_path="c:/Windows/Font/simhei.ttf").generate(word_space_split)
    TypeError: 'module' object is not callable


    求大佬们指点一下,这下我
    2 replies    2017-07-26 23:40:09 +08:00
    337136897
        1
    337136897  
    OP
       Jul 26, 2017
    请问怎样上传文件
    zhanglintc
        2
    zhanglintc  
       Jul 26, 2017
    别的不清楚, 只看报错信息的话:

    TypeError: 'module' object is not callable

    这里看起来说明它不是一个函数或者方法, 你要检查一下 WordCloud 或者 generate, 看看他们是不是一个能够被调用的函数?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4176 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 05:22 · PVG 13:22 · LAX 22:22 · JFK 01:22
    ♥ Do have faith in what you're doing.