Skip to content

Hello

Build a CPU job that streams five greetings, then returns a JSON result. This is the fastest way to prove your login, upload, job, logs, and result flow.

Save this complete app as hello/app.py:

Show complete codeHide complete codehello/app.py
hello/app.py
from __future__ import annotations
import time
from typing import Any
import simulo
app = simulo.App("hello")
@app.job(timeout=5 * 60)
def hello(name: str = "world", repeat: int = 3) -> dict[str, Any]:
"""Print a few greeting lines (the log stream), return a dict (the result)."""
for index in range(repeat):
print(f"[hello] {index + 1}/{repeat}: hello, {name}!", flush=True)
time.sleep(0.3) # long enough for `simulo logs --follow` to visibly stream
return {"greeting": f"hello, {name}", "repeat": repeat}
Terminal window
simulo run hello/app.py --name robot --repeat 5

You will see five greeting lines stream while the job runs. Then read the returned value:

Terminal window
simulo result
{
"greeting": "hello, robot",
"repeat": 5
}
  • @app.job turns a regular typed Python function into a runnable job.
  • With one job, CLI flags map directly to the function parameters.
  • Printed output becomes live job logs; the returned dictionary becomes the job result.

See App & Jobs for the same pattern with more jobs.