Spaces:
No application file
No application file
File size: 470 Bytes
58ac7cc 303a816 58ac7cc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | from daytona import Daytona, DaytonaConfig
# Define the configuration
config = DaytonaConfig(api_key="your-api-key")
# Initialize the Daytona client
daytona = Daytona(config)
# Create the Sandbox instance
sandbox = daytona.create()
# Run the code securely inside the Sandbox
response = sandbox.process.code_run('print("Hello World from code!")')
if response.exit_code != 0:
print(f"Error: {response.exit_code} {response.result}")
else:
print(response.result) |