โดย nuattawoot » 16/06/2017 4:08 pm
มันมีวิธีใช้หรือ วิธีแสดงไหมคับ เพราะบังอยางก็แสดงไม่ได้หรือผมทำไม่ถูกก็ไม่รู้ ขอคำแนะนำหน่อยคับพึงหัดเขียน
พอ return test() มันขึ้น
หน้าเว็บ
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
TypeError: 'int' object is not callable
# -*- coding: utf-8 -*-
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
# return 'Hello World'
return test()
def test():
a=[123,'aaa','aaa','sss','ddd','fff']
var_str = a.count('aaa')
return var_str
#แต่รันแสดงบนคอมมาไลน์ ได้คับ
if __name__ == '__main__':
app.run()
มันมีวิธีใช้หรือ วิธีแสดงไหมคับ เพราะบังอยางก็แสดงไม่ได้หรือผมทำไม่ถูกก็ไม่รู้ ขอคำแนะนำหน่อยคับพึงหัดเขียน
พอ return test() มันขึ้น
หน้าเว็บ
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
[color=#FF0000]TypeError: 'int' object is not callable[/color]
# -*- coding: utf-8 -*-
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
# return 'Hello World'
return test()
[color=#FF0000]def test():
a=[123,'aaa','aaa','sss','ddd','fff']
var_str = a.count('aaa')
return var_str[/color]
#แต่รันแสดงบนคอมมาไลน์ ได้คับ
if __name__ == '__main__':
app.run()