TypeError: 'generator' object is not subscriptable

生成器对象不可以带下标

def get_row(self,row_no):
if not isinstance(row_no,int):
return None
if self.sheet is not None:
return self.sheet.rows[row_no-1]
return None

TypeError: 'generator' object is not subscriptable的更多相关文章

  1. openpyxl使用sheet.rows或sheet.columns报TypeError: 'generator' object is not subscriptable解决方式

    解决方案: 因为新版本的openpyxl使用rows或者columns返回一个生成器所以可以使用List来解决报错问题 >>> sheet.columns[0] Traceback ...

  2. openpyxl中遇到TypeError: 'generator' object is not subscriptable的问题和解决方案

    今天在搭建驱动数据框架用到了一个叫 openpyxl的包用来解析excel数据 随后就出现了TypeError: 'generator' object is not subscriptable的bug ...

  3. Debug 路漫漫-11:Python: TypeError: 'generator' object is not subscriptable

    调试程序,出现以下错误: Python: TypeError: 'generator' object is not subscriptable “在Python中,这种一边循环一边计算的机制,称为生成 ...

  4. python: "TypeError: 'type' object is not subscriptable"

    目前stackoverflow找到两种情况的解决办法: 1.TypeError: 'type' object is not subscriptable when indexing in to a di ...

  5. TypeError: 'NoneType' object is not subscriptable

    运行,显示TypeError: 'NoneType' object is not subscriptable错误信息,原因是变量使用了系统内置的关键字list 重新定义下这个变量就好了

  6. python报错:TypeError: 'int' object is not subscriptable

    检查一遍报错的所在行,此报错一般是在整数上加了下标: 比如:   a = 4   c=a[2] 报错:line 2, in <module>    c=a[2] TypeError: 'i ...

  7. python报以下错误:TypeError: 'int' object is not subscriptable

    原因:数组忘了写下标,数组某项赋值成了 数组对象=数字: 查询其它人的博客,发现仍有其它可能引发此错误,无非是不可以相互操作的对象进行了操作或者是访问对象的方式不对,如:给数字加了下标,对一维数组加了 ...

  8. python类型错误:'NoneType' object is not subscriptable

    TypeError: 'NoneType' object is not subscriptable --> 原因:变量使用了系统内置的关键字list 解决:重新定义下这个变量

  9. python Flask :TypeError: 'dict' object is not callable

    flask 基于Werkzeug .. @moudule.route('/upload', methods=['GET', 'POST']) def upload_file(): global _fl ...

随机推荐

  1. 基于Redis做内存管理

    1 Redis存储机制: redis存储的数据类型包括,String,Hash,List,Set,Sorted Set,它内部使用一个redisObject对象来表示所有的key和value,这个对象 ...

  2. python常用函数 Y

    yield有点像return,但他会在下一次执行的时候从上次结束点继续执行,带有 yield 的函数在 Python 中被称之为 generator(生成器),生成器无法通过索引获取数据,同时也承诺使 ...

  3. QTextStream写文件中文乱码解决办法

    1.首先把Qt Creator的编辑器设置为使用 UTF-8:   工具-->选项-->文本编辑器-->行为,在右侧选项界面找到文件编码选项,设置为 UTF-8.2.使用 QText ...

  4. cx_Oracle python模块安装

    1. 需要从oracle网站下载一下两个包 instantclient-basic-linux.x64-11.2.0.4.0.zip instantclient-sdk-linux.x64-11.2. ...

  5. home home clock

    博客园添加home home clock 将下面代码复制进博客侧边栏广告即可 <div id="myTime"> <object classid="cl ...

  6. LeetCode--049--字母异位词分组(java)

    给定一个字符串数组,将字母异位词组合在一起.字母异位词指字母相同,但排列不同的字符串. 示例: 输入: ["eat", "tea", "tan&quo ...

  7. 英语单词deploy

    来源——https://www.docker.com/ Leading companies rely on our container platform to build, manage and se ...

  8. 使用Windows service创建一个简单的定时器

    一.需求 我们有时候可能会想要做一些定时任务,例如每隔一段时间去访问某个网站,或者下载一些东西到我们服务器上等等之类的事情,这时候windows service 是一个不错的选择. 二.实现 1.打开 ...

  9. spring boot 1.视图解析器,2.开启静态资源访问

    1.spring boot 视图解析器 #视图解析器 #前缀spring.mvc.view.prefix=/pages/ #后缀..jsp.dospring.mvc.view.suffix=.jsp ...

  10. Centos7卸载FastDFS6.1卸载(六)

    今天由于安装了高版本的fastdfs,与nginx不兼容,因此要卸载掉,重新安装. 转载:http://www.leftso.com/blog/244.html ) 停止服务 [root@bogon ...