Random Numbers
Learn how to use Transcrypt to call JavaScript functions from Python and vice versa.
We'll cover the following...
We'll cover the following...
JS functions
At its most basic, Transcrypt allows Python code to call JavaScript functions and enables JavaScript functions to call Python functions. Let’s look at an example that explicitly does both.
This simple example is similar to the previous “Hello, World!” application we did:
Running the application
Use the following command to generate a JavaScript file from our Python code. But this time, let’s transpile the Python code with a few options:
The options in the Transcrypt command did a few things for us. First, the --nomin option causes the resulting JavaScript file not to be minified. This makes it a little easier to see how Transcrypt converts our Python ...