Have you tried to use Flask instead? It start a server that you can access via browser.
Here you can find an Hello world tutorial, or also here.
First, you have to install Flask: pip install Flask.
Then the server code, saved in a python file, for example your_server.py, has to look like this:
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()
You can run the script, then go to http://localhost:5000/ and you'll see the 'Hello World!' message.
Now you can modify the method hello() to do what you need, or create other method/operations.
The tutorial can give you more details, but this is the main concept.