美文网首页
python 中TypeError:'dict'

python 中TypeError:'dict'

作者: 尼古拉斯_特仑苏 | 来源:发表于2017-05-17 14:10 被阅读6420次

TypeError:'dict' object is not callable原因分析:

  1. 代码里重新定义了dict,比如 dict= { },这时你自己调用的是代码里定义的dict而不是python内置类型

  2. 取字典内容时用了()而不是[]。比如sdict("content_id"),应该是sdict["content_id"]

相关文章

网友评论

      本文标题:python 中TypeError:'dict'

      本文链接:https://www.haomeiwen.com/subject/znsdxxtx.html