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.

Source Distribution

pycodeexec-0.0.2.tar.gz (2.7 kB view hashes)

Uploaded source

Supported by

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