Run JavaScript through Python
Usage
To use this library, you must first install the library (pip3 install JSPy)
In your code, you must import JSPy package by including import JSPy.
To execute JavaScript, use the command JSPy.exec(JAVASCRIPT_STRING), where the JAVASCRIPT_STRING is the JavaScript you would like to run. This will automatically run the file and return anything that the system returns.
If you would like to execute a JavaScript File, use the command print(JSPy.exec("FILE", "file")), where FILE is the filename. This will automatically run the file and return anything that the system returns. If an error is thrown relating to the filename, you may have to include the file path.
Common Errors
If you get a JavaScript Runtime Error, you can use the following commands:
sudo apt-get install npm
sudo apt-get install nodejs
If you do not have sudo permissions, you can use the following commands:
curl https://raw.githubusercontent.com/creationix/nvm/v0.25.0/install.sh | bash
nvm install stable
nvm alias default stable
If you are using a Windows Computer/Server, download nodejs from https://nodejs.org/. You may have to restart your computer/server for this to be configured.
Unnoticed Errors
If you would like to report any errors, please open an issue. If you know how to fix the issue, please submit appropriate changes.
Release files for JSPy 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| JSPy-1.0.0.tar.gz | 2.4 kB | Details |
Release files / JSPy-1.0.0.tar.gz
| Download URL | JSPy-1.0.0.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd77a67bdda54cc43448aef4dd45eb58c004f87259957351533148e16ced732a
|
|
BLAKE2b-256 checksum How to use checksums |
5522a5b44fd67b3c57168a1bac55bb664bf9d06d702f94d770efcea9338ffb4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |