今天执行了下之前写的Python接口文件,源码如下,

__author__ = 'Administrator'
#coding:utf-8
from readData import dictionary
readIt = {}
readIt = dictionary.onlyCellValue("E:\python\API\eadData.xls", "Sheet1", 1)
print readIt
for key in readIt:temp_list = readIt[key]for i in range(0, len(temp_list)):print "第"+(i+1)+"个参数为"+temp_list[i]

在运行时报错:TypeError: unbound method onlyCellValue() must be called with dictionary instance as first argument (got str instance instead)

后经在网上查看,发现时由于调用其他类时,未在后面添加括号,添加括号后,运行正常。这是由于未添加括号情况下,未被认为是类的实例,故报此错

改正后的:readIt = dictionary().onlyCellValue("E:\python\API\eadData.xls", "Sheet1", 1)

解决Python中TypeError: unbound method 问题相关推荐

  1. 解决python中TypeError: not enough arguments for format string

    解决python中TypeError: not enough arguments for format string for i in range(1,10):​ for j in range(1,i ...

  2. 解决python中TypeError: not enough arguments for format stringj

    出现这类问题,主要是字符串中包含了%号,python 认为它是转移符,而实际我们需要的就是%, 这个时候,可以使用%%来表示 原文链接:http://blog.csdn.net/benbendy198 ...

  3. 成功解决Python中出现的TypeError: object of type 'zip' has no len()

    成功解决Python中出现的TypeError: object of type 'zip' has no len() 不罗嗦,直接解决问题! 目录 解决问题 解决思路 解决方法 解决问题 TypeEr ...

  4. python cannot concatenate_解决Python 异常TypeError: cannot concatenate 'str' and 'int' objects

    解决Python 异常TypeError: cannot concatenate 'str' and 'int' objects TypeError: cannot concatenate 'str' ...

  5. python字符串拼接数字_解决Python中字符串和数字拼接报错的方法

    解决Python中字符串和数字拼接报错的方法 前言 众所周知Python不像JS或者PHP这种弱类型语言里在字符串连接时会自动转换类型,如果直接将字符串和数字拼接会直接报错. 如以下的代码: # co ...

  6. python画指数函数图像_解决python中的幂函数、指数函数问题

    最近在调代码,碰到幂函数.指数函数,总是提示 ValueError: math domain error ValueError: negative number cannot be raised to ...

  7. python 2: 解决python中的plot函数的图例legend不能显示中文问题

    python 2: 解决python中的plot函数的图例legend不能显示中文问题 参考文章: (1)python 2: 解决python中的plot函数的图例legend不能显示中文问题 (2) ...

  8. 成功解决python中出现的IndentationError: expected an indented block的错误

    成功解决python中出现的IndentationError: expected an indented block的错误 目录 解决问题 解决思路 解决方法 解决问题 当在python中出现这个错误 ...

  9. 成功解决Python中导出图片出现错误SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position

    成功解决Python中导出图片出现错误SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position ...

最新文章

  1. 深入认识二进制序列化--记一次生产事故的思考
  2. 阿里云数据库专家白宸:Redis带你尽享丝滑!(图灵访谈)
  3. 解决crond引发大量sendmail、postdrop进程问题
  4. 新手学信息检索2:倒排表与存储
  5. EclipseLink JPA-RS简介
  6. 织梦众大云采集插件v9.7
  7. 原生js和jquery常用的DOM操作
  8. 一次性掌握机器学习基础知识脉络
  9. mybaitplus 根据id批量进行修改_phpcms小程序插件api接口升级到4.3(新增批量获取、搜索等接口)...
  10. 全网首发:char数组矩阵转bit的算法
  11. LiveReload的下载安装 + Sublime的配置
  12. Java TreeMap
  13. linux打印重定向并打印机,将虚拟打印机的输出重定向到Python脚本
  14. C# 四舍五入保留两位小数方法总结
  15. python爬虫之数据提取、正则表达式、xml、XPath、etree、CSS选择器 BeautifulSoup4
  16. 爬取街拍图片_如何拍摄好街拍照片
  17. uniapp 简单表单布局1
  18. html5悬浮圆圈背景动画特效,html5圆圈浮动背景动画特效
  19. checkbox 点击搜索失去焦点_jquery获取焦点和失去焦点事件代码
  20. 专科学计算机的学校哪个好,计算机专业大学排名专科生学计算机专业好吗

热门文章

  1. fastjson1.2.24TemplatesImpl利用链源码分析
  2. Windows下基础免杀技术
  3. 日语五十音图表 日语学习
  4. 電影嘗試三 webtorrent-desktop在線觀看電影magnet
  5. pm2 start 带参数_pm2 start命令中的json格式详解
  6. [Python中pandas实现独热编码][pd.get_dummies()函数]
  7. Android游戏源码合集(主要是AndEngine和Libgdx的)
  8. 【JavaScript】 模块 module
  9. 大学c语言作业用什么搜题比较好,快速查找题库_什么手机软件可以把题库输入进去然后输入关键字可以查找点道题_淘题吧...
  10. format函数用法详解