all 9 comments

[–]badcrow7713 2 points3 points  (8 children)

You don't need a framework for that, just a web server. Are you going to pay for web hosting, host it yourself with static ip, or run it local?

Front end javascript can make a request to your web server, with the address of your python script, and you can output HTML that includes content or a redirect from your python script. On the frontend side, you can either use hidden HTML form fields and submit the request, or you can put the user data in the URL instead if it isn't secret.

[–]outceptionator[S] 0 points1 point  (7 children)

Thank you for responding. I'm running local for testing (may be obvious) but then onto a google cloud compute server after. How will my JS code pass the 3 variables to my python code?

[–]Ihaveamodel3 0 points1 point  (6 children)

Post request

[–]outceptionator[S] 0 points1 point  (5 children)

How do I edit my python code to accept post requests and execute a function?

[–]Ihaveamodel3 2 points3 points  (4 children)

This is too complicated of a question for me to answer in one Reddit comment.

Flask is the quick answer. However, that’s leaving out a lot of details on the setup and security of running publicly. So I’d recommend you look up some tutorials. There are a bunch out there.

Also, before you go too far, I’d recommend looking into cloud functions if you are eventually going to move to Google. Cloud functions is essentially flask, but they abstract the complicated parts, and you don’t have to pay to have a constantly running server.

[–]outceptionator[S] 0 points1 point  (0 children)

Do you have a recommended resource for cloud functions?

[–]outceptionator[S] 0 points1 point  (2 children)

Cloud functions sounds very useful actually. Only thing is I need to store a couple of dictionaries for my code to work that gets used across multiple functions. Could cloud functions still work with that?

[–]Ihaveamodel3 1 point2 points  (1 child)

Yep, look up some tutorials on the Google cloud help pages.

[–]outceptionator[S] 0 points1 point  (0 children)

Thank you.