How to use python in a JS based app
<p>I have created an app using meteor.js framework. I need to run some python code for some important data crunching that will be used in the app. How can I do that? I am really new to Javascript and cant figure this out. I will be running python code on server. All I need is, as soon as I click a particular button, a piece of python code gets compiled.</p>

<p>You'll need to expose your Python code over some sort of API. Since your Python is "running on the server" as you mentioned.</p>

<p>The fastest way I can think of doing it is to setup an AWS Lambda function (<a href="https://aws.amazon.com/lambda/" rel="nofollow">https://aws.amazon.com/lambda/</a>), then expose it as an API route using AWS API Gateway(<a href="https://aws.amazon.com/api-gateway/" rel="nofollow">https://aws.amazon.com/api-gateway/</a>).</p>

<p>Once your "number crunching" is completed, you'll need to return the relevant variables back to your client app. JSON is probably a good choice for this.</p>

javascript python