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()
1$ export FLASK_APP=hello.py
2$ python -m flask run
3 * Running on http://127.0.0.1:5000/
4
1# This is the code
2# Find me on discord ZDev1#4511
3# We shouldn't install flask in the terminal, it is already imported
4from flask import Flask
5
6app = Flask(__name__)
7
8# route
9@app.route('/')
10# route function
11def home():
12 # send 'hey!'
13 return 'hey!'
14
15# listen
16if __name__ == "__main__":
17 app.run(port=3000)
18 # if you need to make it live debuging add 'debug=True'
19 # app.run(port=3000, debug=True)
20
21 # Hope you enjoyed ;)
1# Imports necessary libraries
2from flask import Flask
3# Define the app
4app = Flask(__name__)
5
6# Get a welcoming message once you start the server.
7@app.route('/')
8def home():
9 return 'Home sweet home!'
10
11# If the file is run directly,start the app.
12if __name__ == '__main__':
13 app.run(Debug=True)
14
15# To execute, run the file. Then go to 127.0.0.1:5000 in your browser and look at a welcoming message.
1from flask import Flask
2app = Flask(__name__)
3
4@app.route('/')
5def hello_world():
6 return 'Hello, World!'
7
1from flask import Flask
2app = Flask(__name__)
3
4@app.route('/')
5def index():
6 return 'Flask'