'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[, ...
随机推荐
- drupal前端开发的第一点
就是把admin/config/development/performance下面的选项全部去掉,方便作为一个匿名用户来访问,不用每次都drush cc all.
- Bootstrap结合BootstrapTable的使用,分为两种模试显示列表。 自适应表格
引用的css: <link href="@Url.Content("~/Css/bootstrap.min.css")" rel="styles ...
- table数据表格添加checkbox进行数据进行两个表格左右移动。
<table class="table table-hover table-striped table-condensed newDateList"> <thea ...
- HashSet其实就那么一回事儿之源码浅析
上篇文章<HashMap其实就那么一回事儿之源码浅析>介绍了hashMap, 本次将带大家看看HashSet, HashSet其实就是基于HashMap实现, 因此,熟悉了HashMap ...
- 注册Github
注册Github 1.打开Github网页 2.设置用户名.邮箱.密码(右侧会显示是否可以使用),点击注册 3.此时邮箱会发来来自Github的注册消息,进入邮箱,点连接,完成注册 4.注册成功
- Makefile三个有用变量$@,$^,$<
$@:目标文件 $^:所有的依赖文件 $<:第一个依赖文件 使用上面三个变量就可以简化我们的Makefile文件: #简化后的Makefile main : main.o log.o test_ ...
- 找做IT的男朋友会不会没有隐私
找做IT的男朋友会不会没有隐私你不觉得自己在网上不断的“秀”啊,“晒”啊的行为才是根本所在吗?你应该怕自己的这种行为才对吧-—————————————————————————————————————— ...
- bzoj 3170: [Tjoi 2013]松鼠聚会
#include<cstdio> #include<iostream> #include<algorithm> #define M 100008 using nam ...
- POJ 2226 最小点覆盖(经典建图)
Muddy Fields Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8881 Accepted: 3300 Desc ...
- Solr安装入门、查询详解
Solr安装入门:http://www.importnew.com/12607.html 查询详解:http://www.360doc.com/content/14/0306/18/203871_35 ...