Skip to content
Advertisement

Is there a way to catch socket.io events without JavaScript in Flask?

My application handels a countdown, which refreshes all the time. The countdown itself is handeld by the server, like so:

JavaScript

Currently I am catching the event data in JavaScript like this:

JavaScript

Q.: Is there a way to catch socket.io events without JavaScript? If so, how could I do this?

Advertisement

Answer

If you are looking to replace javascript with python within your web browser’s client-side code, you might want to look into https://brython.info/

It is essentially just using python within the browser. You wouldn’t have all of those fancy decorators, but it would probably work well enough.

Advertisement