>>> 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. Eclipse SVN 安装步骤

    1.在eclipse中安装svn插件 Eclipse ---> Help ---> Install New Software ---> Add Name : 任意 Location ...

  2. 20160907_Redis问题

    ZC: 今天发现,redis服务器 启动不了了... 下面是 排查/处理过程. 1.查了一遍配置,看了一下前面的博客文章,貌似 这一套流水操作下来应该没问题... 然而,就是起不了... 1.1.安装 ...

  3. python内置函数 3

    int( [x[, radix]])转换为字符串或数字为纯整数.如果参数是一个字符串,它必须包含一个可能有符号的十进制数作为一个 Python 整 数,可能嵌入空格.以 radix 参数给出的基数为基 ...

  4. mysql 关键字于数据库字段于关键字冲突的问题

    如果数据库存储字段 为MySQL关键字,那么在查询或者其他操作时会出错.那么我们应该怎么办, 可能有些人会说,换个字段不就好了啊.当然这样也是可以的,完全没问题. 然而,如果是在无法对数据库进行修改和 ...

  5. ajax 异步插入图片到数据库(单图上传)

    其实也没啥  如图: 点击按钮选择图片,选择完成后 无需点击确定 ,自动上传到服务器指定文件夹 然后插入到数据库中. 下面来看看这要代码 index.php <!DOCTYPE HTML> ...

  6. JavaWeb chapter 2 Servlet

    1.  什么是Servlet: Servlet是运行于Web容器中,按照其自身规范编写的Java应用程序. Servlet是用Java语言编写的,它是一个Java类,因而Servlet遵守所有Java ...

  7. HDU 3016 线段树区间更新+spfa

    Man Down Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...

  8. Jenkins快速上手

    一.Jenkins下载安装 1.到官网下载jenkins.war包:http://jenkins-ci.org/ 2.安装方法有两种: a) 把下载下来的jenkins.war包放到文件夹下,如C:\ ...

  9. hdu 1057 (simulation, use sentinel to avoid boudary testing, use swap trick to avoid extra copy.) 分类: hdoj 2015-06-19 11:58 25人阅读 评论(0) 收藏

    use sentinel to avoid boudary testing, use swap trick to avoid extra copy. original version #include ...

  10. Android Studio项目目录结构

    在Android Studio中,提供了以下几种项目结构类型 我们一般常用的有以下两种结构: Project 结构类型 app/build/ app模块build编译输出的目录 app/build.g ...