1.在运行时报错: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)
--------------------- 作者:emily_and_cat 来源:优快云 原文:https://blog.youkuaiyun.com/emily_and_cat/article/details/41843851?utm_source=copy 版权声明:本文为博主原创文章,转载请附上博文链接!
2.

本文介绍了一种常见的Python错误:TypeError,具体表现为unbound method onlyCellValue() must be called with dictionary instance as first argument (got str instance instead)。错误原因在于调用类方法时未正确实例化类,解决方案是在调用时添加括号以确保方法被正确调用。
1048

被折叠的 条评论
为什么被折叠?



