1#Save the file as app.py
2from flask import Flask
3app=Flask(__name__)
4
5@app.route('/',methods=['GET','POST'])
6
7def Home():
8 return "Hello World"
9
10#Run on command Prompt following commands(Windows):
11# >>cd Desktop/
12# >>cd FlaskFolder
13# >>py -3 -m venv venv
14# >>venv\Scripts\activate
15# >>python app.py
1from flask import Flask
2
3app = Flask(__name__)
4
5@app.route("/")
6def hello_world():
7 return "<p>Hello, World!</p>"
8
9if __name__ == "__main__":
10 app.run(debug=True)
1from flask import Flask
2app = Flask(__name__)
3
4@app.route("/")
5def index():
6 return 'Hello World'
7
8if __name__ == '__main__':
9 app.run(debug=True)
1# Extremely simple flask application, will display 'Hello World!' on the screen when you run it
2# Access it by running it, then going to whatever port its running on (It'll say which port it's running on).
3from flask import Flask
4app = Flask(__name__)
5
6@app.route('/')
7def hello_world():
8 return 'Hello, World!'
9
10if __name__ == '__main__':
11 app.run()