I would like to write a simple python application, that generates a HTML "website" as frontend. It is not meant to be hosted online or to consist of multiple pages. The user will simply open the frontend in a browser.
There should be only one index.html file like this:
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="my-styles.css">
...
</head>
<body>
{python_body_var}
</body>
Where python_body_var is an object (or string-representation) of the python-internal state.
Is there a simple way to implement this? Could I easily register event handlers for buttons etc.?
The important thing about this is, that any user interaction (clicking elements, inserting text, ...) should be noticed in the backend. And the frontend should actively respond to certain changes in the backend.
imgelement.