'str' object is not callable
>>> b=str(11)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'str' object is not callable
原因:定义变量的时候,随机使用str,所以就被覆盖了str函数。可以退出重进python或者del掉自定义str变量。
python中内置了很多的函数和类,在自己定义变量的时候,切记不要覆盖或者和他们的名字重复
>>> del str
>>> str(122)
''
'str' object is not callable的更多相关文章
- Python学习笔记1 -- TypeError: 'str' object is not callable
Traceback (most recent call last): File "myfirstpython.py", line 39, in <module> pri ...
- python报错'str' object is not callable
>>> x=1.235 >>> int(x) 1 >>> str="fsgavfdbafdbntsbgbt" >> ...
- TypeError: 'str' object is not callable
Python报错TypeError: 'str' object is not callable
- 解决Flask和Django的错误“TypeError: 'bool' object is not callable”
跟着欢迎进入Flask大型教程项目!的教程学习Flask,到了重构用户模型的时候,运行脚本后报错: TypeError: 'bool' object is not callable 这是用户模型: c ...
- 调用日志输出错误:TypeError: 'int' object is not callable等
*)TypeError: 'int' object is not callable 错误信息: Traceback (most recent call last): File "Visual ...
- python Flask :TypeError: 'dict' object is not callable
flask 基于Werkzeug .. @moudule.route('/upload', methods=['GET', 'POST']) def upload_file(): global _fl ...
- TypeError: 'module' object is not callable cp fromhttp://blog.csdn.net/huang9012/article/details/17417133
程序代码 class Person: #constructor def __init__(self,name,sex): self.Name = name ...
- TypeError: 'QueryDict' object is not callable
id = int(request.POST('id')) Error message: TypeError: 'QueryDict' object is not callable Error rese ...
- 自学Python2.1-基本数据类型-字符串str(object)
Python str方法总结 class str(object): """ str(object='') -> str str(bytes_or_buffer[, ...
随机推荐
- [原创] RT7 Lite win7旗舰版精简方案
[原创] RT7 Lite win7旗舰版精简方案 墨雪SEED 发表于 2016-1-26 21:23:54 https://www.itsk.com/thread-362912-1-5.html ...
- UIDatePicker的用法
目录[-] 1.Locale 2.Calendar 3.timeZone 4.date 5.minimumDate 6.maximumDate 7.countDownDuration 8.minute ...
- android log
from 点击打开链接 使用Android logcat 对我们开发.调试Android程序有很大的帮助!通过logcat,我们可以非常方便的了解到程序的执行情况,判断出错代码位置. 最简单的log ...
- java length属性 length()方法 size()方法
length是属性,一般用来说明数组的长度 length()是方法,针对字符串String说的,用来求数组中某个元素的字符串长度 String str={"adfasf",&quo ...
- JQuery 对 Select option 的操作
下拉框: <select id="selectID" > <option value="1">1</option& ...
- Objective-C( protocol协议)
protocol 协议 protocol:用来声明方法 1.协议的定义 @protocol 协议名称 <NSObject> // 方法声明列表.... @end 2.如何遵守协议 1> ...
- guava学习--hashing
128位的MurmurHash(烽火使用过): 看一下Java标准库中的非加密哈希算法你会发现少了MurmurHash,这是一个简单高效且还是分布式的算法,在许多语言中都有着很好的支持.我们并不是说要 ...
- Windows Store App 变形特效
在应用程序的开发过程中,为了让界面按照期望的效果显示,有时会对界面元素应用变形特效,例如图片的缩放.旋转.移动等.与3D特效不同,在界面元素实现变形特效之后,其平行关系不会发生改变,只不过是位置.大小 ...
- 解决html中 在不同浏览器中占位大小不统一的问题
直接在html文档中使用 来表示空格,在不同浏览器中的占位大小是不一样的. 为什么呢,因为不同浏览器默认的字体是不一样的,不同字体下的空格表示 占位大小不一致. 这就好办了嘛,我们对 指定使用同样的字 ...
- spring boot注解 --@EnableAsync 异步调用
EnableAsync注解的意思是可以异步执行,就是开启多线程的意思.可以标注在方法.类上. @Component public class Task { @Async public void doT ...