Run Code
Execute source code on a remote node
Signature
def run_code(node_id: str, lang: Language, code: str) -> ExecutionResponseWrapperParameters
node_id(str) – target nodelang(Language) –PYTHON,JAVASCRIPT,TYPESCRIPT, orCPPcode(str) – source code to execute
Returns
ExecutionResponseWrapper with:
output– stdout texterror– stderr text (if any)exit_code– process exit codesuccess– boolean convenience (exit_code == 0and no error)execution_time_seconds– time taken
Example
from heaptree.enums import Language
result = client.run_code(node_id, lang=Language.PYTHON, code="print('Hello')")
print(result.output)Exceptions
MissingCredentialsExceptionInternalServerErrorException