Skip to main content

Run a Python script

from jhansi import Sandbox

with Sandbox(language="python") as sb:
    sb.upload_file("main.py")
    result = sb.exec("python main.py")
    print(result)

Run a Node project

from jhansi import Sandbox

with Sandbox(language="node") as sb:
    sb.upload_zip("my_project.zip")
    result = sb.exec("node index.js")
    print(result)

Run tests

from jhansi import Sandbox

with Sandbox(language="python") as sb:
    sb.upload_zip("my_project.zip")
    result = sb.exec("python app.py", test=True)
    print(result)