Python's application server Flask
is convenient for serving HTTP content from a Python application.
Here's a 'Hello World' example to get started
pip install flask
Create a main.py
containing this.
from flask import Flask
app = Flask(__name__)
@app.route("/")
def index():
return "<h1>Hello World!</h1>"
if __name__ == "__main__":
app.run(host='0.0.0.0',port=5051)