TypeError: 'str' object is not callable
来源:互联网 发布:淘宝漏洞1元买东西 编辑:程序博客网 时间:2024/05/20 17:40
Python报错TypeError: 'str' object is not callable
当一般内部函数被用作变量名后可能出现此错误。比如:
range=1
for
………
就会报这样的错误
这样的错会报在for行,但是时间引起的原因却是在range=1这行,如果两行相距较远,怎很难被发现。所以要特别注意不要用内部已有的变量和函数名作自定义变量名。
或者str被预先定义了
str=10
for i in range(1,10):
a=‘5’
b=str(a) 也会报错
参考:
http://blog.sina.com.cn/s/blog_71f3890901017rsh.html
http://www.phperz.com/article/14/1208/39956.html
0 0
- TypeError: 'str' object is not callable
- TypeError: 'str' object is not callable
- TypeError: 'str' object is not callable
- TypeError: 'str' object is not callable
- TypeError: 'str' object is not callable
- TypeError: 'str' object is not callable
- TypeError: 'str' object is not callable
- TypeError: 'str' object is not callable
- TypeError: 'str' object is not callable
- TypeError: 'str' object is not callable
- TypeError: 'str' object is not callable
- python错误:TypeError: 'str' object is not callable
- Python报错TypeError: 'str' object is not callable
- Python报错TypeError: 'str' object is not callable
- Python报错TypeError: 'str' object is not callable
- str' object is not callable
- python的exit退出时,提示TypeError: 'str' object is not callable
- 《Django学习》遇到的问题:“TypeError:'str' object is not callable"
- day10_python2和python3的继承
- Codeforces 705C Thor (模拟)
- OpenSceneGraph实现的NeHe OpenGL教程 - 第二十八课
- jzoj 3076. 【备战NOIP2012图论专项模拟试题】位图
- php 自带过滤和转义函数
- TypeError: 'str' object is not callable
- 基于R-CNN的物体检测-CVPR 2014
- 通过ip地址及端口连接服务器
- php高手干货【必看】
- OpenSceneGraph实现的NeHe OpenGL教程 - 第二十九课
- ActiveMQ实现消息队列发送邮件
- 笔记:自定义标签
- 简单的ViewPager使用
- 静态建树之——寻找前缀是否是其他字符串