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
```
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
Release history Release notifications | RSS feed
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)