Spaces:
Runtime error
Runtime error
Download app.py from iShare/JavascriptPython: direct link, hf CLI and curl.
- Browser
- Download file 319 Bytes
-
https://huggingface.co/spaces/iShare/JavascriptPython/resolve/8b08c36029db37a013378af7623da9256f3d7921/app.py
- Command line
-
hf download hf://spaces/iShare/JavascriptPython@8b08c36029db37a013378af7623da9256f3d7921/app.py
-
curl -L -o app.py https://huggingface.co/spaces/iShare/JavascriptPython/resolve/8b08c36029db37a013378af7623da9256f3d7921/app.py
319 Bytes
| import execjs | |
| # Define some JavaScript code | |
| js_code = """ | |
| function addNumbers(a, b) { | |
| return a + b; | |
| } | |
| var result = addNumbers(2, 3); | |
| """ | |
| # Use execjs to execute the JavaScript code | |
| ctx = execjs.compile(js_code) | |
| # Get the result of the JavaScript code | |
| result = ctx.eval('result') | |
| # Print the result | |
| print(result) |