pycharm python @符號不能識別 NameError: name 'app' is not definedpython
解決辦法:spring
缺乏:app = Flask(__name__)flask
# 導入Flask類 from flask import Flask # 實例化,可視爲固定格式 app = Flask(__name__) # route()方法用於設定路由;相似spring路由配置 @app.route('/quark/callback/<int:sid>') def hello_world(sid): return 'Hello, World!' if __name__ == '__main__': # app.run(host, port, debug, options) # 默認值:host=127.0.0.1, port=5000, debug=false app.run(host='0.0.0.0', port=38002, debug=True)