This is a simple Python "sidecar" application that calculates the geometric properties of a circle. It's designed to be called by a parent process (like the Tauri app) and communicates over standard input/output using JSON.
- The script enters an infinite loop, waiting for input.
- It reads a single line from
stdin. - It parses the line as a JSON object (e.g.,
{"payload": {"radius": 10}, "metadata": {"center": {"x": 150, "y": 150}}}). - It uses the
calculatormodule to compute the circle's area and perimeter. - It formats the result as a JSON object.
- It prints the resulting JSON string to
stdout, followed by a newline, to signal completion to the calling process.