當前位置:編程學習大全網 - 電腦編程 - python代碼問題 TypeError: 'int' object is not callable

python代碼問題 TypeError: 'int' object is not callable

python flask 報錯: TypeError: 'int' object is not callable

描述:python + flask,希望能返回循環次數,報錯: TypeError: 'int' object is not callable

代碼:

app=Flask(__name__)

@app.route('/')

def index():

hah = 0

print('hello word!')

return hah

解決方案:

app=Flask(__name__)

@app.route('/')

def index():

hah = 0

print('hello word!')

return str(hah)

本文轉自“python flask 報錯: TypeError: 'int' object is not callable_其他語言_編程問答”

  • 上一篇:PLC編程什麽時候用BIN指令,怎麽用。
  • 下一篇:自動化三次元蔡司如何手動運行
  • copyright 2024編程學習大全網