Python提示:TypeError: 'NoneType' object is not callable的解决办法

Posted kekeoutlook

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python提示:TypeError: 'NoneType' object is not callable的解决办法相关的知识,希望对你有一定的参考价值。

这种错误有很多种原因,目前我在做接口自动化测试的时候遇到的这个问题,方法在调用的时候将()去掉即可

 

from guizero import App, Text

# Action you would like to perform
def counter():
    text.value = int(text.value) + 1

app = App("Hello world")
text = Text(app, text="1")
text.repeat(1000, counter)  # Schedule call to counter() every 1000ms  函数调用不能加括号
app.display()

  

以上是关于Python提示:TypeError: 'NoneType' object is not callable的解决办法的主要内容,如果未能解决你的问题,请参考以下文章