Created
July 30, 2026 04:58
-
-
Save syrusakbary/3f17e1f8f080e3d110746d2d52e7eeab to your computer and use it in GitHub Desktop.
Wasmer SDK Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # uv add wasmer-sdk / pip install wasmer-sdk | |
| import asyncio | |
| from wasmer_sdk import Wasmer | |
| async def main() -> None: | |
| client = Wasmer() | |
| sandbox = await client.sandboxes.create( | |
| packages=["python/python", "wasmer/edgejs-quickjs", "php/php-32",] | |
| ) | |
| print((await sandbox.command("echo", ["hello from shell tools"]).run(check=True)).text().strip()) | |
| print((await sandbox.command("python", ["-c", "print('hello from Python')"]).run(check=True)).text().strip()) | |
| print((await sandbox.command("edge", ["-e", 'console.log("hello from Edge.js")']).run(check=True)).text().strip()) | |
| print((await sandbox.command("php", ["-r", "echo 'hello from PHP';"]).run(check=True)).text().strip()) | |
| asyncio.run(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment