Commands / kosa8 cloud code
kosa8 cloud code
Run Python in a stateful interpreter in a cloud sandbox; charts come back as images
Usage
kosa8 cloud code ID [CODE]
Runs a Python cell in a context whose globals last between calls (like a notebook). The code is the argument, else --file, else stdin. Charts (matplotlib) come back as PNGs, saved with --save DIR. It needs a persistent sandbox: kosa8 cloud sandbox create --persistent.
Options
| Flag | Type | What it does | Default |
|---|---|---|---|
--context | string | the context to run in (default: default) | — |
-f, --file | string | read the code from this file | — |
--save | string | save returned images (charts) into this folder | — |
--timeout | duration | stop the cell after this long | 1m0s |
Example
kosa8 cloud code sbx_abc 'x = 21' kosa8 cloud code sbx_abc 'print(x * 2)' kosa8 cloud code sbx_abc -f plot.py --save ./charts kosa8 cloud code contexts sbx_abc