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 codehello/app.py
from __future__ import annotations
import timefrom 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}Run the app
Section titled “Run the app”simulo run hello/app.py --name robot --repeat 5You will see five greeting lines stream while the job runs. Then read the returned value:
simulo result{ "greeting": "hello, robot", "repeat": 5}What to reuse
Section titled “What to reuse”@app.jobturns 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.