using python to control animations

This is more python than blender (I think), so I’m posting it here.
Hypothetical question:
Let’s say I have 3-4 small and short blender animations, one of which serves as a timer (when it stops the game is over and the player has a very simple score - either win or lose).
The other animations are controled by a button for each one. Pressing these and playing the animations IS the game itself.
I’d like to test this on a web page on a nginx server (offline), and have the scores sent to either a Mambo DB or a mariaDB - not mysql. Again as a test.
I’m no python expert, so if someone can point me in the right direction??
I’m assuming the above is possible? There may be random numbers involved too. I’ve fooled around with that in php, but not python.
And an additional question, for the above nginx, python, etc. would the animations have to be in a specific format?

I think you should render the animations into a format that web pages can handle easily. JPG or PNG, maybe even a video. But from your question I gather that you don’t really have the knowledge to create this kind of browser-based game yet.

I would recommend you to learn a Web framework first. Django or Flask for example. Then learn CSS and javascript well. Somewhere along that road it should be obvious to you how to implement that game.

you guessed right. I’m trying to determine what is possible, the least amount of time, etc. I’ve looked at a lot of this, and blender animations and web pages don’t seem to go together unless there’s an intermediate step.
Anyone else out there with -‘best ways to go about this’?