flask python 3 code example
Example 1: install flask
pip install flask
Example 2: install flask
pip install -U Flask
Example 3: python flask
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return "Hello world!"
if __name__ == '__main__':
app.debug = True
app.run()
Example 4: Install Flask
pip install flask
Or If The Problem is "pip" not Found Use :
py -m pip install flask
Example 5: import flask
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
Example 6: how to import flask
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello, World!"