>>> 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的更多相关文章

  1. Python学习笔记1 -- TypeError: 'str' object is not callable

    Traceback (most recent call last): File "myfirstpython.py", line 39, in <module> pri ...

  2. python报错'str' object is not callable

    >>> x=1.235 >>> int(x) 1 >>> str="fsgavfdbafdbntsbgbt" >> ...

  3. TypeError: 'str' object is not callable

    Python报错TypeError: 'str' object is not callable

  4. 解决Flask和Django的错误“TypeError: 'bool' object is not callable”

    跟着欢迎进入Flask大型教程项目!的教程学习Flask,到了重构用户模型的时候,运行脚本后报错: TypeError: 'bool' object is not callable 这是用户模型: c ...

  5. 调用日志输出错误:TypeError: 'int' object is not callable等

    *)TypeError: 'int' object is not callable 错误信息: Traceback (most recent call last): File "Visual ...

  6. python Flask :TypeError: 'dict' object is not callable

    flask 基于Werkzeug .. @moudule.route('/upload', methods=['GET', 'POST']) def upload_file(): global _fl ...

  7. 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   ...

  8. TypeError: 'QueryDict' object is not callable

    id = int(request.POST('id')) Error message: TypeError: 'QueryDict' object is not callable Error rese ...

  9. 自学Python2.1-基本数据类型-字符串str(object)

    Python str方法总结 class str(object): """ str(object='') -> str str(bytes_or_buffer[, ...

随机推荐

  1. 深入SpringBoot:自定义PropertySourceLoader

    http://www.jianshu.com/p/5206f74a4406 ********************************* 前言 上一篇文章介绍了SpringBoot的Enable ...

  2. myeclipse/eclipse没有Project Facets的解决方法

    http://www.cnblogs.com/jerome-rong/archive/2012/12/18/2822783.html 经常在eclipse中导入web项目时,出现转不了项目类型的问题, ...

  3. solr 6.1 服务端 tomcat 搭建及调用

    一.下载 apache solr6.1.0 最新版本zip,解压缩生成一个solr6.1.0文件夹 二.安装 1.在d:/projects下新建一个solr 2.把solr6.1.0/server/s ...

  4. gitgub利用客户端实现简单的上传和同步

    新建项目 打开客户端(将项目拷贝到本地) 选择要clone到的文件夹 想该文件夹中,导入自己需要上传的代码 然后,在网站上登录自己的gitgub,就可以看到刚才上传的项目了╮(╯▽╰)╭

  5. c# string.format json字符串 formatException错误

    正常字符串的string.format是没问题的但是在拼接json的字符串的时候因为里面包含了 {}  花括号 里面又嵌套了 {0} {1} {2}这些要替换的关键字 所以会报错. 经过百度. 字符串 ...

  6. mysql 删除重复数据保留一条

    验证:mysql 5.6版本 方法一: delete a from table a left join( select (id) from table group by studentName,cla ...

  7. MYSQL 基于GTID的复制

    1.概述 从MYSQL5.6 开始,mysql开始支持GTID复制. 基于日志点复制的缺点: 从那个二进制日志的偏移量进行增量同步,如果指定错误会造成遗漏或者重复,导致数据不一致. 基于GTID复制: ...

  8. /etc/passwd和/etc/shadow

    这两个路径分别是用于存储密码和隐形密码 让我们先来观察它,在了解它 [root@oc3408554812 ~]# cat /etc/passwd |grep carltoncarlton    :   ...

  9. iOS开发UI篇—简单介绍静态单元格的使用

    iOS开发UI篇—简单介绍静态单元格的使用 一.实现效果与说明 说明:观察上面的展示效果,可以发现整个界面是由一个tableview来展示的,上面的数据都是固定的,且几乎不会改变. 要完成上面的效果, ...

  10. 手机抓包-fiddler

    如果app走的是http协议,不用root,只需要通过fiddler做代理,就可以抓到所有请求. 1. fiddler+手机wifi设置 安装fiddler,勾中 Fiddler Options -& ...