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()

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM