Python for web development

pip install Flask
from flask import Flask

# Create a Flask application
app = Flask(__name__)

# Define a route for the homepage
@app.route('/')
def hello_world():
    return 'Hello, World!'

# Run the Flask application
if __name__ == '__main__':
    app.run(debug=True)
python app.py
Open your web browser and navigate to http://localhost:5000/. You should see a "Hello, World!" message displayed on the webpage.
Posted in Q&A