找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 2966|回复: 1

[已解决] 新手求助。这段代码什么意思?

1

主题

1

帖子

1

积分

贫民

积分
1
nightshaodw3 发表于 2016-8-27 11:41:25 | 显示全部楼层 |阅读模式
如果发现出错,应该去哪里查看代码错误原因?


本人非常新手


  1. Exception in thread Thread-2:
  2. Traceback (most recent call last):
  3.   File "C:\Python3\lib\threading.py", line 914, in _bootstrap_inner
  4.     self.run()
  5.   File "C:\Python3\lib\threading.py", line 862, in run
  6.     self._target(*self._args, **self._kwargs)
  7.   File "C:\pp\webpagecheck12.py", line 23, in md5CodeCompare
  8.     ccc=chardet.detect(html)['encoding'] #识别编码
  9.   File "C:\Python3\lib\site-packages\chardet-2.3.0-py3.5.egg\chardet\__init__.py", line 28, in detect
  10.     u = universaldetector.UniversalDetector()
  11. AttributeError: module 'chardet.universaldetector' has no attribute 'UniversalDetector'
  12. Exception in thread Thread-3:
  13. Traceback (most recent call last):
  14.   File "C:\Python3\lib\threading.py", line 914, in _bootstrap_inner
  15.     self.run()
  16.   File "C:\Python3\lib\threading.py", line 862, in run
  17.     self._target(*self._args, **self._kwargs)
  18.   File "C:\pp\webpagecheck12.py", line 23, in md5CodeCompare
  19.     ccc=chardet.detect(html)['encoding'] #识别编码
  20.   File "C:\Python3\lib\site-packages\chardet-2.3.0-py3.5.egg\chardet\__init__.py", line 28, in detect
  21.     u = universaldetector.UniversalDetector()
  22. AttributeError: module 'chardet.universaldetector' has no attribute 'UniversalDetector'
复制代码


回复

使用道具 举报

5

主题

101

帖子

101

积分

版主

Rank: 7Rank: 7Rank: 7

积分
101

最佳新人活跃会员热心会员突出贡献

QQ
落叶秋风 发表于 2016-8-27 16:54:10 | 显示全部楼层
chardet.universaldetector模块没有UniversalDetector这个属性,简而言之就是你使用了他没有的属性,他巧妇难为无米之炊,变不出来你想的属性给你
回复 支持 1 反对 0

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表