Run a python file when Jetson AGX Xavier startup or at boot time

Hello, I am using Nano and I want to run a python file when my AGX start-up.
i followed this link:Run a python/sh file when Jetson start-up, but nothing run. I just thought procedure for AGX is similar as Jetson nano.
So can I know some other way to do that?

This strikes me as a linux question. Here are some examples: Run a Script on Startup in Linux | Baeldung on Linux

Nope, The solutions mentioned in this blog not working for me.
Now, I written a python just display an image using OpenCV, and followed the /etc/rc.local method to run python code at boot time. At booting time I got the error, screenshot attached as below and jump to the main screen.

you might want to ask jetson questions on the appropriate jetson forum