Ket*_*ale 7 python user-interface cmd flask
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
Run Code Online (Sandbox Code Playgroud)
我是烧瓶的新手。我编写了此基本代码并将其保存在 D:\Cat_vs_Dog\scripts 文件夹中的 hello.py 中。
然后在命令提示符下,我写了以下命令。
C:\Users\Ketan Ingale>set FLASK_APP=D:\Cat_vs_Dog\scripts\hello.py
C:\Users\Ketan Ingale>flask run
* Serving Flask app "D:\Cat_vs_Dog\scripts\hello.py"
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
Usage: flask run [OPTIONS]
Error: Could not import "D".
Run Code Online (Sandbox Code Playgroud)
我收到此错误。我该怎么办...?
小智 12
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
app.run()
Run Code Online (Sandbox Code Playgroud)