Skip to main content

Execute arbitrary code from a multitude of supported languages

Project description

# PyCodeExec
Simple python library that can execute arbitrary code from supported programming languages.

# Usage

### Synchronous JavaScript
```python
from pycodeexec import Runner

javascript = Runner("javascript")
output = javascript.get_output("console.log([...Array(10)].map(i=>i*i))")

print(output)
# [ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81 ]
```

### Also supports Asyncio
```python
from pycodeexec.asyncio import Runner

javascript = Runner("javascript")
await javascript.is_ready()
output = await javascript.get_output("console.log([...Array(10)].map(i=>i*i))")

print(output)
# [ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81 ]

```

# Supported Languages
* Python
* JavaScript
* Ruby
* C
* More to come

# Installation
```bash
pip install pycodeexec
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pycodeexec, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size pycodeexec-0.0.2.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page