'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[, ...
随机推荐
- Element is not currently visible and so may not be interacted with错误
用selenium定位时,碰到这种错误的原因: 此种问题的关键是在于用className和id都不唯一所以找不到对象 所以,碰到这种问题就换一种定位方式
- css代码段
css文字超出省略 .demo{ display:-webkit-box; overflow:hidden; text-overflow:ellipsis; -webkit-line-clamp:2; ...
- 亚马逊云服务器AWS安装CentOS
亚马逊云服务器默认创建的实例,在停止之后再启动的情况下,IP会发生改变.所以我们最好先创建一个弹性IP,即EIP,不过我也不清楚这个费用. 1.按如图操作创建一个弹性IP,弹性IP创建之后可以随便绑定 ...
- 【nginx】利用yum源安装nginx
先安装nginx的yum源 http://nginx.org/en/linux_packages.html#stable 找到链接,安装: rpm -ivh http://nginx.org/pack ...
- Yii2框架安装(windows)
-->安装PHP环境Wamp集成环境,XAMMP等.-->安装Composerhttp://pan.baidu.com/s/1i3fejjvPS:安装过程中的有一个手动操作项选择php.e ...
- blocked file type by sharepoint 分类: Sharepoint 2015-07-05 07:45 6人阅读 评论(0) 收藏
o add or remove blocked file types by using Central Administration Verify that you have the followin ...
- 由ArrayList构造函数源码引出的问题
ArrayList应该用得很多了.最近看了看其源码,发现有很多细节,如果要我们自己来实现,估计会考虑不到.当然,这些细节跟jdk本身一些实现的bug有关,如果不去深挖,定然是不能发现.本文从Array ...
- find_in_set()
$where[]="find_in_set('".$grades."',a.grades)";
- Jenkins 2.26 发布,可扩展的持续集成引擎
Jenkins 2.26 发布了.Jenkins 主要用于持续.自动地构建/测试软件项目,如CruiseControl与DamageControl,监控一些定时执行的任务.更新内容: Allow Co ...
- 《Java中的包机制》
/* 包的机制:(1) */ package lee; public class PackageTest { public void Test(int num) { System.out.printl ...