0

I have a website written in python(flask) which I would like to some realtime functionality to. I have looked at some websockets implementations for python, but none of them seem as straightforward and simple as socket.io for Node.js.

Is it possible(and furthermore, practical) to write the realtime component in Node.js and integrate with python(e.g., when a page is hit in the python code, execute this node.js function), or is it just a waste of time?

any help is appreciated!

1 Answer 1

1

Is it possible? Yes. For example, you could have a web server route the websocket-related paths to node.js/express and the rest of them to your python/flask app. Is it practical? Probably not, but it's a case-by-case judgement call. How cleanly separated are the real-time vs traditional aspects of your application? At the end of the day if your integration between 2 daemons in 2 different languages is significantly more complicated that just finding or writing a working python websocket implementation, you might want to stick with python.

Sign up to request clarification or add additional context in comments.

2 Comments

I'm reading over questions I asked years ago in high school, and I just wanted to say thank you for answering this question clearly and patiently. It's not a very well thought out or insightful question (from the perspective someone who actually knows what they're doing, which high school me definitely did not), but as someone who had the internet as a first teacher I greatly appreciate people who are still patient with beginners.
This made my day. Thanks for the follow-up!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.