Running Python code on startup using systemd. Code does start at boot up but stops and service ends

Duplicate with:
https://forums.developer.nvidia.com/t/failing-to-have-a-python-code-run-on-startup-on-ubuntu-18-04-running-on-jetson-tx2-help/159351/4
(although this is centered more on using systemd, so this is probably the better URL to use…just don’t use two for the same thing)

I don’t have this to set up and try, but I see this as a conflict:

After=multi-user.target
...
WantedBy=multi-user.target

This is saying multi-user.target wants this, and that this is not allowed until multi-user.target is reached. You cannot both require this for multi-user.target and make this available until after multi-user.target.

You should also be very careful to find out if your software will run with no X/GUI session. Python would not have an issue with this, but some camera software must have an X context.