I am considering working on a project to emulate circuits in order to get more invested in an electronic circuits class that I am currently taking. I have found it useful to create Python scripts to work on my homework calculations, but now I would like to make a website to share with classmates to use these scripts.
From my understanding, I can run only run Javascript on the browser and can only use Python on the backend. I've gotten comfortable with using Python for math and have heard that it's better in general for mathematics. In my assignments, the most that I've worked with is pi and long floating point numbers.
So...
Would it be worth my time to create a python backend to run calculations? Or can I get by with browser `Javascript` for calculations. I am comfortable with both languages.
Also as a follow-up question, could I use Flask to run Python in the browser?
Thank you!
The only case in which one would definitely be preferable to the other would be if the calculations to be performed may get very expensive, in which case it would be much more user-friendly to have the server shoulder the load, rather than having the client do it (since low-end clients may become unresponsive for too long while calculating).
If that's a potential issue for your case, running the expensive code on the backend would be the way to go. (It doesn't have to be Python on the backend - it could even be server-side JS, or even PHP or whatever else you prefer and is performant enough for your needs.)
If that isn't something to worry about for your case, then feel free to choose whatever you like (calculate on the client or on the server), using whatever approach you're most comfortable with - there isn't an objective way to choose between them.
Would it be better to use Javascript or Python for calculations on my website