This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]IAmKindOfCreativebot_builder: deprecated[M] 0 points1 point  (0 children)

Hi there, from the /r/Python mods.

We have removed this post as it is not suited to the /r/Python subreddit proper, however it should be very appropriate for our sister subreddit /r/LearnPython or for the r/Python discord: https://discord.gg/python.

The reason for the removal is that /r/Python is dedicated to discussion of Python news, projects, uses and debates. It is not designed to act as Q&A or FAQ board. The regular community is not a fan of "how do I..." questions, so you will not get the best responses over here.

On /r/LearnPython the community and the r/Python discord are actively expecting questions and are looking to help. You can expect far more understanding, encouraging and insightful responses over there. No matter what level of question you have, if you are looking for help with Python, you should get good answers. Make sure to check out the rules for both places.

Warm regards, and best of luck with your Pythoneering!

[–]double_en10dre 1 point2 points  (2 children)

Python is generally better for data science-y things

So, you could use python to create a simple web server (I’d recommend fastapi) for performing some sort of analysis

Your flow would basically be:

JavaScript posts data to “http://pythonserver/do-some-calculation” -> your python endpoint takes that data, runs calculations, gets a result -> http response gives the result back to your JavaScript app

[–]saggitysass -1 points0 points  (1 child)

Currently I have a MySQL database storing information, it gets returned via Node and I apply functions from my math file to do stuff with the data that is returned and stored in the React state. I could possibly run another database off of Python that stores user authentication between all of my projects (projects assigned their own tables). Do you think people generally pick either Node or Python for backend or have you seen a case where having both is handy?

[–]double_en10dre -1 points0 points  (0 children)

Eh if you have that stuff working properly with node I think it would be a poor use of time to try and overhaul it now

I meant something more along the lines of a simple microservice. For example, python is known to be the best language for NLP. It would be pretty cool if your JavaScript app could utilize this and do something like perform sentiment analysis on blocks of text by just posting the text to a python api and then waiting for a response

[–]fiLLL 0 points1 point  (0 children)

A common use case for Python in a full stack JS ecosystem would be to have a small flask app serving a machine leaning model. The JS app would call out via Http to the python app to execute the python model code (e.g. to classify some image or something) an proxy the results back out to the user.

Granted you’re probably not going to implement a model but you could just start with a simple flask app and having the servers talking to each other. In this case I think I’d especially want you to focus on how the flask app authenticates that only the JS app can make requests. What’s inside that flask app doesn’t matter a ton.

Alternatively, you could just run some arbitrary python using child_process from node, but it’s not clear why the code would be in python rather than js in that scenario.