这个错误是python 使用match 匹配的时候没有匹配到内容, 仍然使用了 group 这个时候报错了

所以处理方法就是检查下想要匹配的内容是否有写错的地方,

例如下面的代码运行就会报错

str_content = "Python is a good language"
re_content = re.match("python", str_content)
print(re_content)
print(re_content.group())

这里把python 修改为Python 再次运行

str_content = "Python is a good language"
re_content = re.match("Python", str_content)
print(re_content)
print(re_content.group())

错误处理了 打印结果如下:

AttributeError: ‘NoneType‘ object has no attribute ‘group‘相关推荐

  1. Traceback (most recent call last): File AttributeError: 'NoneType' object has no attribute 'group'

    Traceback (most recent call last):File "<stdin>", line 1, in <module> Attribut ...

  2. Keras问题“AttributeError: 'NoneType' object has no attribute 'update”解决

    BUG 在使用Keras训练模型时,在每个epoch完成后save_model时会报错 "AttributeError: 'NoneType' object has no attribute ...

  3. pyspark AttributeError: 'NoneType' object has no attribute 'setCallSite'

    pyspark: AttributeError: 'NoneType' object has no attribute 'setCallSite' 我草,是pyspark的bug.解决方法: prin ...

  4. Pywinauto 应用后端类型选择错误:AttributeError: ‘NoneType‘ object has no attribute ‘backend‘. 原因及解决办法

    AttributeError: 'NoneType' object has no attribute 'backend'. 错误原因: 选择的应用后端类型不对. windows 上应用的后端类型有两种 ...

  5. 成功解决AttributeError: ‘NoneType‘ object has no attribute ‘shape‘

    成功解决AttributeError: 'NoneType' object has no attribute 'shape' 目录 解决问题 解决思路 解决方法 解决问题 multiplier = [ ...

  6. 成功解决AttributeError: 'NoneType' object has no attribute '__array_interface__'

    成功解决AttributeError: 'NoneType' object has no attribute '__array_interface__' 目录 解决问题 解决思路 解决方法 原因及思路 ...

  7. AttributeError: 'NoneType' object has no attribute 'grid'报错解决方案

    1问题描述: 当我们在使用tkinter时经常遇到AttributeError: 'NoneType' object has no attribute 'grid'的报错 2.原因分析: import ...

  8. Python学习笔记:‘’AttributeError: NoneType object has no attribute‘’

    前言 最近在学习python,犯了很多低级错误,总结一下 目录 文章目录 前言 目录 问题 出处 方案 问题 AttributeError: 'NoneType' object has no attr ...

  9. 解决AttributeError AttributeError: 'NoneType' object has no attribute 'filename'

    原因忘记上传文件 表单需要加属性 enctype="multipart/form-data" 否则报错!AttributeError AttributeError: 'NoneTy ...

最新文章

  1. Windows10下SSH远程拷贝文件
  2. 70个Python练手项目列表,看了让你茅塞顿开~
  3. sql建表,建索引注意事项
  4. php加mysql分页_php mysql 分页函数
  5. 4-玩转数据结构-链表
  6. 国家发钱了!研究生补贴一览表!
  7. 悖论对计算机科学影响,数学和计算机科学的核心逻辑悖论
  8. IDEA通过Database连接MySql数据库
  9. typescript的基本类型
  10. 头条搜索已经全面上线,会不会成为下一个流量风口
  11. 结合CmakeList来更好地理解windows下的动态库和静态库
  12. 关于Cocos2d-x中实例伸缩后的位置设置
  13. Mysql表的过滤查询
  14. 机械臂——六轴机械臂构型分析与MATLAB建模
  15. 万娟 白话大数据和机械学习_白话大数据与机器学习
  16. 2019 WordPress免费收费中文主题推荐 强迫症患者的救赎
  17. android 访问win10共享文件夹,win10系统用手机es文件浏览器访问共享文件的操作方法...
  18. 阿里云的认证多少分通过?没通过可以补考吗?
  19. 笑过后值得思考的一些编程语录----------搞笑却真实
  20. 伪造邮件***,看我如何给网易邮箱APP发送垃圾邮件【二】

热门文章

  1. Go 编译的可执行文件是否有动态库链接?
  2. 2022-2028年中国领带行业投资分析及前景预测报告
  3. Pandas 使用入门
  4. torch.nn.functional.cross_entropy.ignore_index
  5. Pytorch源码与运行原理浅析--网络篇(一)
  6. Jeff Dean回顾谷歌2021
  7. TensorFlow六种激活函数
  8. 中继TensorRT集成
  9. Turing渲染着色器网格技术分析
  10. 使用现场总线更快更远