1.AttributeError: 'NoneType' object has no attribute 'group'

  1. import re
  2. s=r'<title>kobe<\title>'
  3. ret = re.search('<\w+><\\w+>',s)
  4. print(ret.group(0))
  5.  
  6. 属性错误: "NoneType"对象没有属性'group'
    说明:search或者match返回回来的结果为'None',是空类型,所以在调用group的时候报错(说白了就是正则可能写的不对,没返回结果,就报错)

 2.StopIteration

  1. li = [1,2,3,4]
  2. ss = li.__iter__()
  3. while 1:
  4. abc = ss.__next__()
  5. print(abc)
  6.  
  7. Traceback (most recent call last):
  8. File "E://python汇总/123.py", line 84, in <module>
  9. abc = ss.__next__()
  10. StopIteration
  11.  
  12. 生成器停止错误:是由于生成器里面没有数据能被迭代出来的时候,会报次错误,要在返回或者输出的地方做异常处理

 3.error: command 'gcc' failed with exit status 1

  1. 由于没有正确安装Python开发环境导致
    yum install python-devel

返回系列

python报错记录的更多相关文章

  1. Python报错总结丶自定义报错

    Python报错总结: 常见异常 1,NameError: name 'a' is not defined:未定义函数名             2,IndentationError: uninden ...

  2. Python报错module 'scipy.misc' has no attribute 'xxx'

    Python报错module 'scipy.misc' has no attribute 'imresize' 解决办法: 安装Pillow包,命令如下: pip install Pillow 然后重 ...

  3. selenium python 报错“ unable to find binary in default location”

    selenium python 报错如下: raise exception_class(message, screen, stacktrace)selenium.common.exceptions.W ...

  4. 报错记录(xml抬头报错)

    报错记录(xml抬头报错) Referenced file contains errors (http://www.springframework.org/schema/beans/spring-be ...

  5. IDEA 报错记录

    IDEA 报错记录 Process finished with exit code 0 这种主要是配了默认的 Tomcat ,然后又配置了外部的 Tomcat.解决办法,注释掉默认的: <dep ...

  6. Spring Boot 报错记录

    Spring Boot 报错记录 由于新建的项目没有配置数据库连接启动报错,可以通过取消自动数据源自动配置来解决 解决方案1: @SpringBootApplication(exclude = Dat ...

  7. 解决Python报错:local variable 'xxx' referenced before assignment(引)

    解决Python报错:local variable 'xxx' referenced before assignment(引) 解决Python报错:local variable 'xxx' refe ...

  8. python 报错 wxPyDeprecationWarning: Using deprecated class PySimpleApp.

    如题:python 报错 提示为 : wxPyDeprecationWarning: Using deprecated class PySimpleApp. 解决:将 wx.PySimpleApp() ...

  9. PyCharm 中文 字符 python 报错 的 完美 解决方案!

    PyCharm 中文 字符 python 报错 的 完美 解决方案! #_*_ coding:utf-8_*_ https://www.python.org/dev/peps/pep-0263/ 到p ...

随机推荐

  1. Discovery Scanning

    1.NetDiscover you performe layer 2 the comand  : netdiscover -r 192.168.2.0/24   or use   netdiscove ...

  2. 饮冰三年-人工智能-Python-21 Python数据库MySql

    一:下载与安装 1:下载地址:https://dev.mysql.com/downloads/mysql/ 2:安装MySql 打开下载文件解压到指定文件目录.(我这里解压目录为D:\MySql\my ...

  3. python中的while循环和for循环

    1.while循环 Gif 演示 Python while 语句执行过程 while 语句时还有另外两个重要的命令 continue,break 来跳过循环,continue 用于跳过该次循环,bre ...

  4. python之使用 wkhtmltopdf 和 pdfkit 批量加载html生成pdf,适用于博客备份和官网文档打包

    0. 1.参考 Python 爬虫:把廖雪峰教程转换成 PDF 电子书 https://github.com/lzjun567/crawler_html2pdf wkhtmltopdf 就是一个非常好 ...

  5. Linux awk学习

    零.awk标准语法 [root@wohaoshuai1 bbb]# echo "abcd" |awk 'BEGIN{print "wohaoshuai"} /a ...

  6. DPI与DFI技术分析

    DPI全称为“Deep Packet Inspection”,称为“深度包检测”.DPI技术在分析包头的基础上,增加了对应用层的分析,是一种基于应用层的流量检测和控制技术,当IP数据包.TCP或UDP ...

  7. python使用urllib2 http 下载参数的try catch

    import urllib2 req = urllib2.Request('http://blog.csdn.net/cqcre')try: urllib2.urlopen(req)except ur ...

  8. gets()的替代问题

    gets()的替代方法 1.<iostream>中getline (char* s, streamsize n) 2.scanf("%[^\n]",s);

  9. HDU 3949 XOR [线性基|高斯消元]

    目录 题目链接 题解 代码 题目链接 HDU 3949 XOR 题解 hdu3949XOR 搞死消元找到一组线性无关组 消出对角矩阵后 对于k二进制拆分 对于每列只有有一个1的,显然可以用k的二进制数 ...

  10. Docker操作笔记(二)容器

    容器 一.启动容器 启动一个容器有两种方式: 1.基于镜像新键并启动一个容器: 所需要的主要命令为docker run docker run ubuntu:18.04 /bin/echo " ...