hello_world¶
Overview¶
The hello_world application is a basic example that demonstrates the fundamental structure of a Raya application.
Execution¶
To run the application, use:
python3 hello_world/ --auto-run
Behavior¶
- Setup Phase
Initializes the application.
Logs a message:
"Hello from setup()".Initializes a counter:
i = 0.
- Loop Phase
Runs every second (
LOOP_DELAY = 1.0).Increments
iand logs:"Hello from loop() {i}".Repeats until
i == 5, then stops the application.
- Finish Phase
Logs a message:
"Hello from finish()".Exits the application.
Example output¶
[INFO] [timestamp] [pyraya.hello_world]: Auto running the app
[INFO] [timestamp] [pyraya.hello_world]: Hello from setup()
[INFO] [timestamp] [pyraya.hello_world]: Hello from loop() 1
[INFO] [timestamp] [pyraya.hello_world]: Hello from loop() 2
[INFO] [timestamp] [pyraya.hello_world]: Hello from loop() 3
[INFO] [timestamp] [pyraya.hello_world]: Hello from loop() 4
[INFO] [timestamp] [pyraya.hello_world]: Hello from loop() 5
[INFO] [timestamp] [pyraya.hello_world]: Hello from finish()
Key Notes¶
This example helps users understand the setup-loop-finish structure of a Raya application.
The loop runs exactly 5 times, demonstrating how to control execution flow.
The finish() method ensures clean termination of the application.