beta
beta

Reputation: 5666

create html with python script

i have a python script which should get input from an html page, then do some data processing based on data in an sqlite-database and return some data (maybe already producing the html).

what is the best light-weigt architecture and workflow to do that? i think django would be overkill, since it's should just will be a small app with little functionality.

however, i'd like to know how this is done best practice wise. should it be some sort of ajax calls to the python script on a server? who generates the html (js, or python?)? etc.

i just need some advice on how to get started. thanks in advance.

Upvotes: 0

Views: 73

Answers (1)

code monkey
code monkey

Reputation: 2124

You could use Flask.

Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions.

It is perfect for smaller projects and easy to use. Just take a look at the short Hello World code snippet:

from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()

Upvotes: 1

Related Questions