Python报错TypeError: 'str' object is not callable
来源:互联网 发布:jquery post 返回json 编辑:程序博客网 时间:2024/06/05 19:42
原文:http://blog.sina.com.cn/s/blog_71f3890901017rsh.html
Python报错TypeError: 'str' object is not callable
当一般内部函数被用作变量名后可能出现此错误。比如:
range=1
for
………
就会报这样的错误
这样的错会报在for行,但是时间引起的原因却是在range=1这行,如果两行相距较远,怎很难被发现。所以要特别注意不要用内部已有的变量和函数名作自定义变量名。
或者str被预先定义了
str=10
for i in range(1,10):
还有一种情况:类名不能和实例名一样,一样了也会报这个错误
阅读全文
1 0
- 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
- 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: 'int' object is not callable
- Python: TypeError: 'int' object is not callable
- python TypeError: 'module' object is not callable
- selenium账号密码验证并退出
- HashTable vs HashMap
- Struts :Exception starting filter struts2
- further occurrences of HTTP header parsing errors will be logged at DEBUG level.错误
- 洛谷P2831 [Noip2016]愤怒的小鸟
- Python报错TypeError: 'str' object is not callable
- OpenCV实现膨胀与腐蚀
- python:logistic,softmax函数
- AC自动机
- 浏览器缓存详解:expires,cache-control,last-modified,etag详细说明
- 【剑指offer】面试题61:扑克牌中的顺子
- 使用Oracle VM VirtualBox安装Ubuntu14.04.5并安装jdk,tomcat
- iOS 图片处理-图片旋转和裁剪
- How to solve laptop